Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Regular Coder
    Join Date
    Jan 2006
    Posts
    568
    Thanks
    6
    Thanked 84 Times in 84 Posts

    UL overlaps float:left div (as though it has a negative margin-left)

    Hi,

    I have a list on my page which overlaps a floating menu, causing the bullet points to be displayed inside the menu's border.

    I have googled, but didn't find anything useful. I don't think it's the doctype - I have tried HTML 4, XHTML and none - or any error in my CSS.

    Firebug displays a left margin relative to its parent, not to the menu div directly to its left, as I'm assuming it should.

    Obviously if I add a left margin it will look wrong whenever it's not in line with a floated div.

    The problem can be seen here, http://www.threeguesses.co.uk/test.html

    The CSS is /index.css

    Tested in Firefox, IE8 and Opera - exactly the same.

    If anyone's got any ideas on how I could make the visible margin always the same regardless of where the UL is, please let me know.

    Cheers,
    Gus

  • #2
    Regular Coder Jazzo's Avatar
    Join Date
    Apr 2008
    Location
    New York City
    Posts
    164
    Thanks
    20
    Thanked 2 Times in 2 Posts
    Try
    Code:
    ul {
    display: block;
    }
    ~Julian
    14 y/o web developer, drummer, and Bridge player

  • #3
    Regular Coder
    Join Date
    Jan 2006
    Posts
    568
    Thanks
    6
    Thanked 84 Times in 84 Posts
    Thanks for the reply; I tried adding display:block but it didn't fix it.

  • #4
    Regular Coder Candygirl's Avatar
    Join Date
    Apr 2008
    Location
    Switzerland
    Posts
    183
    Thanks
    3
    Thanked 56 Times in 56 Posts
    Hello,
    Code:
    ul {list-style-position:inside;}
    ?
    "Imagination was given to man to compensate for what he is not;
    a sense of humour to console him for what he is."
    -Francis Bacon

  • Users who have thanked Candygirl for this post:

    gusblake (12-16-2009)

  • #5
    Regular Coder
    Join Date
    Jan 2006
    Posts
    568
    Thanks
    6
    Thanked 84 Times in 84 Posts
    Yes that worked, thanks.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •