SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Aug 2012
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    IE8 vertically centering an <img> in a <div> - line-height?

    Hi,

    I'm trying to vertically center these pepsi images using the line-height method,
    but it isn't working in IE8. Does anybody have any suggestions?

    Here it is:

    http://joshtaggart.com/line-height/photo-grid.html

    Thanx for your help!

  2. #2
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,355
    Mentioned
    179 Post(s)
    Tagged
    6 Thread(s)
    Hi,

    They are vertically centred in IE8 but won't be vertically centred in IE7 and under though.

    For ie7 and under you can approximate vertical centering by increasing the font-size.

    e.g.
    Code:
    .horizontal{font-size:125px}

  3. #3
    SitePoint Member
    Join Date
    Aug 2012
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanx so much, Paul O'B! That's Awesome!


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
  •