Not signed in (Sign In)

SkillShare - A place to discuss Web Standards and Web Design topics

Categories

Vanilla 1.1.9 is a product of Lussumo. More Information: Documentation, Community Support.

    • CommentAuthorvarland
    • CommentTimeJun 15th 2007
     permalink
    I'm working on a design where I have some list items vertically centered in a box (an image that's 33px tall). To do so, I've made the list items display: block, float: left, height: 33px, and line-height: 33px. This works exactly like I want.

    All of the text on the page is relatively sized using ems. I was hoping that since I defined the line-height in absolute terms (pixels), the items would remain vertically centered when I resize the text, but this is not the case.

    Is there any way to do what I'm asking (without javascript, which can do it, but it's a pain)?
    • CommentAuthorDandruff
    • CommentTimeJun 16th 2007
     permalink
    assuming that this is your body:
    body { font-size:10px; }

    You should try that:
    li { height:3.3em; line-height:3.3em; }
    • CommentAuthorDandruff
    • CommentTimeJun 21st 2007
     permalink
    how it went?
    • CommentAuthorvarland
    • CommentTimeJun 21st 2007
     permalink
    I'm sorry I didn't reply. I didn't try your method because I already know it won't work. Firefox will resize pixel-sized fonts. So, when the font goes larger than 10px, 3.3em will also expand. Thanks, though.
    •  
      CommentAuthorenvisean
    • CommentTimeJun 22nd 2007
     permalink
    varland, I don't believe what you're asking CSS to do is going to be possible except w/ javascript like you said earlier.
Add your comments
    Username Password
  • Format comments as (Help)