CSS Vertical Centering

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Garr
    New Member
    • Jul 2008
    • 2

    CSS Vertical Centering

    I have a page I'm working on that I need to get some text centered between the top and bottom of an image. The page is XHTML and CSS valid. The URL is

    http://seraphim.garrmu sic.com/members.php

    I'm trying to get the characters' names centered vertically against the round icons declaring the character's origin and archetype, but I can't figure how to do it. I tried using the vertical-align rule but it didn't seem to have any affect.

    My CSS is valid, but not consolidated yet, so please forgive. If you have any other tips to add in addition to helping with this issue, feel free.

    Thanks!
  • drhowarddrfine
    Recognized Expert Expert
    • Sep 2006
    • 7434

    #2
    Actually, it's not the characters that need centering but the images. Images are aligned to the baseline of the text. Try adding img{vertical-align:bottom} to those icons and see if that works.

    Comment

    • Garr
      New Member
      • Jul 2008
      • 2

      #3
      You, my friend, are a genius. That worked. Thank you for your help.

      Comment

      • dlite922
        Recognized Expert Top Contributor
        • Dec 2007
        • 1586

        #4
        Originally posted by Garr
        You, my friend, are a genius. That worked. Thank you for your help.
        He's been called worse


        ;)

        Comment

        Working...