Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

h:outputText value to align center

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.

like image 836
DaeYoung Avatar asked Sep 06 '25 15:09

DaeYoung


1 Answers

style="display: block; width:100%; text-align:center;"

works with me :)

like image 188
user3385657 Avatar answered Sep 09 '25 07:09

user3385657