23. Style Sheets

Many years ago when the World Wide Web was new, I remember learning Hypertext Markup Language (HTML) and having fun creating documents with lots of colored and styled text using only a small amount of very simple markup. After a while, I realized that I was creating a maintenance problem for myself because I had lots of repeated code that was setting the same colors and fonts on multiple HTML elements. This problem was solved when Cascading Style Sheets (CSS) were introduced and supported by the mainstream web browsers. CSS made it possible to define these repeated colors and fonts as styles and to apply them to the HTML by defining rules that specify which elements should have which styles.

The same problem arises in rich client ...

Get JavaFX™ Developer’s Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.