freelance84 Posted April 30, 2010 Share Posted April 30, 2010 I've got a button using css: #button-submit_1 { cursor:pointer; width:80px; height: 24px; margin-right:auto; margin-left:auto; color:#666666; text-align: center; font-size: small; vertical-align: middle; background-color: #CCCCCC; } But how do i get the text to be vertically in the middle? Quote Link to comment Share on other sites More sharing options...
n000bie Posted May 1, 2010 Share Posted May 1, 2010 add line-height:24px; Quote Link to comment Share on other sites More sharing options...
freelance84 Posted May 1, 2010 Author Share Posted May 1, 2010 That hasn't worked. The button in the page looks like this: <td><button id="button-submit_1" type="submit">login</button></td> After adding the the new line to the css, it looks like: #button-submit_1 { cursor:pointer; width:80px; height: 24px; line-height:24px; margin-right:auto; margin-left:auto; color:#666666; text-align: center; font-size: small; vertical-align: middle; background-color: #CCCCCC; } The 'g' in login on the button touches the bottom of the button and doesn't look very good. I've tried changing loads of settings but i can't get it to lift up. Quote Link to comment Share on other sites More sharing options...
n000bie Posted May 1, 2010 Share Posted May 1, 2010 try this, used padding instead of height (hope this works) #button-submit_1 { cursor:pointer; width:80px; margin-right:auto; margin-left:auto; color:#666666; text-align: center; font-size: small; vertical-align: middle; background-color: #CCCCCC; padding:2px 0; } Quote Link to comment Share on other sites More sharing options...
freelance84 Posted May 2, 2010 Author Share Posted May 2, 2010 Thanks, taking the height off has worked. Bit wierd that Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.