Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Strange reaction to setting display:inline width

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #28794
    dcp3450
    Participant

    I have items in a ul I want inline and to have a specific width. I my menu this way:
    html

    css

    Code:
    #menu li
    {
    display: inline;
    }

    #menu li a
    {
    display: block;
    float: left;
    width: 150px;
    }

    This works great. No problems in any browser. The li’s line up and the a tags allow me to set my widths.

    I’m working on a table like layout and need the same thing but with out links so I did this:
    html

    Code:
    • Item 1
    • Item 2
    • Item 3
    • Item 4
    • Item 5

    css

    Code:
    #list li
    {
    display: inline;
    }

    #list li span
    {
    display: block;
    float: left;
    width: 150px;
    }

    Works in firefox and chrome. However, IE (of course) only displays them as a block element.

    I’m doing my menu the same way it works fine. Any ideas?

    #74537
    dcp3450
    Participant

    yeah, i found one line that I meant to removed when I was testing something else.

    I forgot i had an element with clear:both in it. Once I removed it everything worked.

Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘CSS’ is closed to new topics and replies.