taming lists

They have: 36 posts

Joined: Oct 2004

Can anyone please tell me why this code wont work properly.

Untitled

#h-contain {
border: 1px solid #000;
margin-bottom: 25px;
padding: 5px;
}

#pipe ul {
margin-left: 0em;
padding-left: 0px;
display: inline;
color:blue;
}

#pipe ul li {
margin-left: 0;
padding: 3px 15px;
border-left: 1px solid #000;
list-style: none;
display: inline;
}

#pipe ul li.first {
margin-left:0;
border-left:none;
list-style:none;
display:inline;
}


  • Item 1

  • Item 2

  • Item 3

  • Item 4

Its supposed to be a horizontal list but for some reason the PIPE id selector in the css is not being applied to the markup, indeed none of the css is being applied to the list. If i remove all the id's for the list from both the css and html it works fine, but for the life of me i cant figure out why it wont work like this. It validates fine.

the code was taken from http://www.alistapart.com/articles/taminglists/

Thanx in advance Confused Confused

Megan's picture

She has: 11,421 posts

Joined: Jun 1999

If you look at their code, they've got the ID on the DIV, not on the UL. So if you do this instead:

  • Item 1
  • Item 2
  • Item 3
  • Item 4

It will work.

They have: 36 posts

Joined: Oct 2004

Where do you see a div?
The Pipe id value is definately supposed to apply to the ul, you can see this by looking at the css rule,

#pipe ul {Rules}

The above is litteraly stating..."apply the rules to any ul element with an id value of 'pipe'".

Thanks for your help anyway, but i think the problem must lie in some silly little thing that we both have'nt spoted yet...I realy would be greatful for any more help from you.

Thanx

They have: 36 posts

Joined: Oct 2004

AHHHH..I see it now, i should have looked at the source in the first place. Boy do I feel dumb now. Sorry i ever doubted you.
Thanks alot.

Megan's picture

She has: 11,421 posts

Joined: Jun 1999

No problem Smiling What that CSS rule is saying is "apply this rule to any ul within the element with an id value of 'pipe'."

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.