There is a small difference in defining the CSS properties for the JavaFX components. All the properties must be prefixed with -fx-, that is, background-color becomes -fx-background-color. The selectors, that is, #id and .class-name still remain the same in the JavaFX world as well. We can even provide multiple classes to the JavaFX components, thereby applying all these CSS properties to the components.
The CSS that I have used in this recipe is based on a popular CSS framework called Bootstrap (http://getbootstrap.com/css/).