It's all about vertical aligning

Discussion in 'CSS' started by Scorpiono, Nov 17, 2008.

  1. #1
    <img src="images/logo.png" alt="embedchat.com" />
    <div id="topmenu">
    <ul>
    <li><a href="#">Quick register</a> |</li>
    <li><a href="#">Learn more</a> |</li>
    <li><a href="#">Contact</a></li>
    </ul>
    </div>
    Code (markup):
    Okay so, the image has a height of 112px and I have a display:inline <li> for the menu's (SEO SEMANTIC CODING made me do this)

    Any ideas how to put the text on the baseline of the image. The img is float left and the #topmenu is float right

    Keep the information in mind, I can't change alot. Rep will be added and I highly appreciate an answer.
     
    Scorpiono, Nov 17, 2008 IP
  2. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #2
        <div>
          <img src="your.gif"
               alt="" />
    
          <ul>
            <li>first item</li>
    	<li>second item</li>
          </ul>
    ============
    ul, li {
      display: inline;
      }
    Code (markup):
    cheers,

    gary
     
    kk5st, Nov 17, 2008 IP
  3. Scorpiono

    Scorpiono Well-Known Member

    Messages:
    1,330
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    120
    #3
    nah nah, I already know that, I needed the text aligned at the base of the image, at the bottom.
     
    Scorpiono, Nov 17, 2008 IP
  4. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #4
    Just what do you think that does? You didn't even test it, did you?

    gary
     
    kk5st, Nov 17, 2008 IP
  5. Scorpiono

    Scorpiono Well-Known Member

    Messages:
    1,330
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    120
    #5
    I don't know what wrong with mines, looks somehow similar, I removed the span and left it as you have it.

    Maybe it's because of float:left (on the main div that contains all) and float:right (on the ul, but I removed it.)
     
    Scorpiono, Nov 17, 2008 IP
  6. Scorpiono

    Scorpiono Well-Known Member

    Messages:
    1,330
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    120
    #6
    <div id="logo">
    <img src="images/logo.png" alt="embedchat.com" />
    <ul>
    <li><a href="#">Quick register</a> |</li>
    <li><a href="#">Learn more</a> |</li>
    <li><a href="#">Contact</a></li>
    </ul>
    </div>
     
    Scorpiono, Nov 17, 2008 IP
  7. Scorpiono

    Scorpiono Well-Known Member

    Messages:
    1,330
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    120
    #7
    Keep in mind, the ul,li are inline.
     
    Scorpiono, Nov 17, 2008 IP
  8. Scorpiono

    Scorpiono Well-Known Member

    Messages:
    1,330
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    120
    #8
    Fixed with position:relative then absolute then bottom:0px;
     
    Scorpiono, Nov 17, 2008 IP