Wednesday, March 26, 2014

Re: How to style text of Label vertically?

CSS has vertical-align, but it only defines how the text is aligned to other text/images in the same line of text (so it only works for inline elements, see http://www.css4you.de/example/vertical-align.html) or how things are aligned inside a table cell.

If you want to vertically center text then you should center the Label and not the text inside that Label. If you really need to center the text inside a large/tall Label then you have to set the line-height property to the same value as the height of the Label. But if your text inside that Label can break to a new line then it will look silly because of the larger than normal line-height.

-- J.

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment