This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes Issue with centering Label text Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Issue with centering Label text" Watch "Issue with centering Label text" New topic
Author

Issue with centering Label text

Steve Renard
Ranch Hand

Joined: Apr 27, 2007
Posts: 66
I'm trying to create labels with background and borders.
I want the text inside the labels to be displayed at both the horizontal and vertical center.
I'm able to get the text at the horizontal center of the label.
I used "style=text-align:center;" to get that working..
However I could not get the text at the vertical center.
I tried many style attributes.
I used 'vertical-align' style attribute too, which doesn't work..
Any suggestions?
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
try line-height

Eric
Steve Renard
Ranch Hand

Joined: Apr 27, 2007
Posts: 66
Perfect!!!
Works great...
Thanks a lot...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Issue with centering Label text
 
Similar Threads
unable to get alignment and widths right
Layout problem with the gaps
WHY DONT APPLETS EXECUTE???
My JSP page won't center!
Remove Horizontal Scrool bar in Mozilla Firefox browser?