At the moment I have a piece of text defined with Text in my FXML. It is also located inside a TextFlow which is inside a ScrollPane. I have tried aligning the text to center in the FXML itself and in css but still doesn't seen to be working. Here is the FXML
<ScrollPane fx:id = "scrollPane">
<content>
<TextFlow styleClass="txtFlow">
<children>
<Text styleClass="h1" text="Title" textAlignment="CENTER"/>
<Text styleClass="h2" text=" Subtitle"/>
</children>
</TextFlow>
</content>
</ScrollPane>
And here is the CSS
.h1{
-fx-font-family: "Helvetica";
-fx-font-size: 50px;
-fx-fill: #147cb0;
-fx-underline: true;
-fx-alignment: center; }