tags:

views:

236

answers:

2

Hi, I am having a hard time trying to change the width of my h:outputLabel, but I still could not get it changed.

By using CSS, I can change the color, font, frame, anything but NOT the WIDTH.

Thank you so much.

+4  A: 

The HTML label element which is generated by h:outputLabel is by default displayed as a widthless inline element. You need to set its CSS display property to block to be able to change the width.

E.g.

label {
    display: block;
    width: 150px;
}
BalusC
A: 

It works perfectly, Thank you very much.

Nhut Le
You're welcome. You should however not post comments as answers. Please post comments as comments by `add comment` link below the question/answer you'd like to comment on. You should also mark accepted answers as accepted. Also see my comment below your question.
BalusC