I am trying to assign two different styles to the same type of node of a JavaFX application.
For example, suppose I have two Text nodes
<Text text="Welcome" GridPane.columnSpan="2" GridPane.halignment="CENTER"
GridPane.rowIndex="0" />
<Text text="Goodbye" GridPane.columnSpan="2" GridPane.halignment="CENTER"
GridPane.rowIndex="0" />
and an application.css
Text {
-fx-font-size: 15pt;
-fx-font-family: Tahoma;
-fx-font-weight: bold;
}
This way, I will style both texts with the same class. How can I create and assign two different styles to the two instances of Text?