<ul> tag and css

He has: 8 posts

Joined: Nov 2005

Hi,

I got a question about the

    tag.
    (X)HTML display's the element (tag) as block.
    That means that, if I have 2 unordered list (
      ), the browser will
      display them top of eachother. Now I want to change that to an inline display.
      Something like that:

- list - list
- list - list
- list - list

Is that possible?
I try this but it did't work for me.
ul.list {display:inline}'

Thx.

Renegade's picture

He has: 3,022 posts

Joined: Oct 2002

You'll probably want to float them. One to the left, and one to the right.

If that doesn't work, try putting them inside a DIV and then floating the DIVs.

He has: 8 posts

Joined: Nov 2005

Thx,
it works. I had to make some changes but it seems to work fine in Firefox, Opera and
even IE.
I thought that It will work with inline but it seems that it does't. Oke Thx.

02bunced's picture

He has: 412 posts

Joined: May 2005

try

ul li {display: inline; }

He has: 8 posts

Joined: Nov 2005

Thx,

I try that, but not with enough satisfaction.
But when I test it wiht more unordered list's I came with a conclusion
that it will work when I see the

    as a block... So the way that I've treid
    and the way that 02bunced explaind is correct.
    explenesion:
    CSS- code
    ul li {display: inline;}
    '

(X)HTML-code

<ul>
<li>LIST A1</li>
<li>LIST A2</li>
</ul>
<ul>
<li>LIST B1</li>
<li>LIST B2</li>
</ul>
<ul>
<li>LIST C1</li>
<li>LIST C2</li>
</ul>
<ul>
<li>LIST D1</li>
<li>LIST D2</li>
</ul>
'

The output is:

   
    * LIST A1     * LIST A2
    * LIST B1     * LIST B2
    * LIST C1     * LIST C2
    * LIST D1     * LIST D2
  
'

So you can use float to work this out, thx Renegade.
And you can do it wiht inline.
I'm happy again.

Roo's picture

She has: 840 posts

Joined: Apr 1999

Just curious...does it validate that way? I mean wrapping with

      with no closing tags in the parent ul container?

robfenn's picture

He has: 471 posts

Joined: Jun 2005

Haven't you answered your question there Roo? It must close to be valid.

He has: 8 posts

Joined: Nov 2005

I just edit it. I think that it is valid now, Roo.

Renegade's picture

He has: 3,022 posts

Joined: Oct 2002

There is an article on Alistapart on what you're trying to do:
http://www.alistapart.com/articles/layeredfudge/

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.