taming lists
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
Megan posted this at 13:06 — 8th May 2006.
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:
It will work.
StuPeas posted this at 13:45 — 8th May 2006.
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
StuPeas posted this at 14:18 — 8th May 2006.
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 posted this at 17:40 — 8th May 2006.
She has: 11,421 posts
Joined: Jun 1999
No problem 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.