Using type selectors

In addition to the previous methods you can address JavaFX elements through the type selectors, using their short class name:

GridPane {    -fx-background-color: lightblue;     -fx-padding: 10px;}

Here, we are setting the background color and padding properties for all GridPane objects that are styled using this CSS.

Get Mastering JavaFX 10 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.