SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict
    Join Date
    Mar 2004
    Posts
    260
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    floating list items to base align with text

    Hello, I've been struggling with this and would be grateful for some help here.

    I've got a navigation list in the footer of a webpage and the list items are supposed to run in the same line as some other text. However, they're too high and I don't know why. Here a link:

    http://stage.truedesign.electra-2.ti...businesses.php

    Many thanks

  2. #2
    Community Advisor silver trophybronze trophy
    dresden_phoenix's Avatar
    Join Date
    Jun 2008
    Location
    Madison, WI
    Posts
    2,796
    Mentioned
    34 Post(s)
    Tagged
    2 Thread(s)
    Floats do just that.. they FLOAT UP to the top of their containers.

    I've been in this trick situation myself and have reasoned that there are usually one of 3 options:

    1) If am off by specific amount, I use margin-top ( the amount) to push the float down so that it's flushed with the content; since your ul is transparent , you could also use padding-top. BTW, chances are that the offset is cause by the padding, line height and font size of the site info

    2) If this is not possible, or you dread the math (it's usually not that hard to do, but people do dread math)... you could try grouping the two elements, and using display:inline-block ; vertical-align: top; and , on the container element, text-align:whatever; ( this assume you want both elements to display ADJACENT (not opposite) to each other on the left or right of the container

    3) If you have painted yourself into a corner, but still can guess the amount by which your position is offset, you could use position:relative; top: (amount).


    Hope that helps

  3. #3
    SitePoint Addict
    Join Date
    Mar 2004
    Posts
    260
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Great – I've got it fixed with inspiration from you! Thanks Mr. dresden_phoenix.


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
  •