I was trying to align center the value of h:outputText tag which is surrounded by div tag. I found out that example 1) meets my goal however I was hoping to use css class to meet the need but I've not been successful. Example 2) is what I have tried which failed.
Example 1)
<div align="center">
<h:outputText value="Have a blessed day!" />
</div>
Example 2)
<div class="header">
<h:outputText value="Have a blessed day!" /.
</div>
In css file
.header {
align: center;
}
// tried also text-align
.header {
text-align: center;
}
[update] I'm sorry. It was a false alarm. Indeed text-align worked. The browser I was using, IE 10, displayed cached data so I was misled.
style="display: block; width:100%; text-align:center;"
works with me :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With