SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Evangelist dhtmlhelp's Avatar
    Join Date
    May 2003
    Posts
    575
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Aligning button text

    Hi,

    does anyone know how to vertically align the text displayed on an html button? I have given a button a custom size. IE6 automatically centers the button text vertically and horizontally inside the button, however NS and Mozilla completely ignore any vertical positioning.

    DH

  2. #2
    Ceci n'est pas Zoef Zoef's Avatar
    Join Date
    Nov 2002
    Location
    Malta
    Posts
    1,111
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by dhtmlhelp
    however NS and Mozilla completely ignore any vertical positioning.
    And so they should, according to the specification.

    Coming back to your problem I came up with this:
    Code:
    .mybutton {
    	font-size:1em;
    	width:10em;
    	height:10em;
    	padding-top:4em;
    	padding-bottom:4em;
    }
    I did it with em's but you could also use px or another unit, just make sure you use the same unit on all these properties for it not to break.

    Tested on IE5.5 and Moz1.0 btw.

    Rik
    English tea - Italian coffee - Maltese wine - Belgian beer - French Cognac


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •