Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    May 2008
    Location
    Michigan
    Posts
    216
    Thanks
    10
    Thanked 1 Time in 1 Post

    Vertically align text in select dropdown

    I assigned my form elements (input, select, textarea) a height of 30px and width of 200px, and set the line-height to 30px so the text vertically aligns. The vertical align seems to be working for every element except the select dropdown. The select text aligns to the top left. Anyway I can fix this?

    Code:
    input, select, textarea {
    height:30px;
    line-height:30px;
    width:200px;
    }
    
    <select name="role">
    <option value="admin">Admin</option>
    <option value="user">User</option>
    </select>
    I appreciate any help. This has been an ongoing problem for some time, and I've finally had time to ask for help lol

  • #2
    Mr.
    Mr. is offline
    Regular Coder
    Join Date
    Feb 2011
    Posts
    112
    Thanks
    8
    Thanked 4 Times in 4 Posts
    are you talking about centered like the drop down menus on this page...

    http://www.cssu.com/

    Wish you gave a link to what you're talking about.

  • #3
    Regular Coder
    Join Date
    May 2008
    Location
    Michigan
    Posts
    216
    Thanks
    10
    Thanked 1 Time in 1 Post
    Yes, and I see that they just added padding. I was hoping this could've been achieved with line-height, but I guess not. :-\


  •  

    Posting Permissions

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