In my FXML file, the structure is as follows:
...
<BorderPane id="header">
<right>
<Label styleClass="title" text="A Label" />
</right>
</BorderPane>
...
I also have a CSS file with the following content:
#header .title { -fx-text-file: #FFFFFF; -fx-font-size: 18px; }
When applying the -fx-text-file
property from the CSS file, the label turns white as expected. However, the -fx-font-size: 18px
does not seem to change the font size. Strangely enough, adding style="-fx-font-size: 18px;"
directly to the Label element in FXML does alter the font size.
Do you have any insight into why the font size is not changing when specified in the CSS file?