Controlling the "depth" of <UL> or <LI> ??

C

capricious

Is it possible, so that when you do multiple <UL>'s to control how
deep the UL's are marked? For example, it would defaultly look like
this with multiple ULs and LIs:

-- Code :
Main Menu<ul>Fruits<ul><li>Apples</li><li>Oranges</li></ul></ul>

-- Returns :
Main Menu
$B!|(B Fruits
$B!{(B Apples
$B!{(B Oranges

-- But, what I want:

Main Menu
$B!|(B Fruits
Apples
Oranges

I am pretty sure you can do stuff like .whatever div div div { your
css; } - so it will effect only a 3rd level embedded div (I believe
thats the purpose, at least). Is this how this would be done? My
experiments have all failed me. Any advice would be greatly
appreciated.

P.S. I am forced into this due to the way that Joomla! lays out its
menu system. If you know about the Joomla 1.5 menu system, you will
understand exactly what I am trying to do I think :)

Thanks in advance!
 
D

dorayme

capricious said:
Is it possible, so that when you do multiple <UL>'s to control how
deep the UL's are marked? For example, it would defaultly look like
this with multiple ULs and LIs:

-- Code :
Main Menu<ul>Fruits<ul><li>Apples</li><li>Oranges</li></ul></ul>
I am pretty sure you can do stuff like .whatever div div div { your
css; }

No, you can't do this. The unordered list element takes only list
elements, you cannot put ordinary character data.

<ul>Fruits... is already wrong.
 
J

Jonathan N. Little

capricious said:
Is it possible, so that when you do multiple <UL>'s to control how
deep the UL's are marked? For example, it would defaultly look like
this with multiple ULs and LIs:

-- Code :
Main Menu<ul>Fruits<ul><li>Apples</li><li>Oranges</li></ul></ul>

-- Returns :
Main Menu
$B!|(B Fruits
$B!{(B Apples
$B!{(B Oranges

-- But, what I want:

Main Menu
$B!|(B Fruits
Apples
Oranges

I am pretty sure you can do stuff like .whatever div div div { your
css; } - so it will effect only a 3rd level embedded div (I believe
thats the purpose, at least). Is this how this would be done? My
experiments have all failed me. Any advice would be greatly
appreciated.

P.S. I am forced into this due to the way that Joomla! lays out its
menu system. If you know about the Joomla 1.5 menu system, you will
understand exactly what I am trying to do I think :)

Thanks in advance!

First of all your markup is invalid. Another UL can not be a child of UL
it must be a LI.

So your markup should be:

<ul><li>Fruits<ul><li>Apples</li><li>Oranges</li></ul></li></ul>
^^^^ ^^^^^

Now if you want to change the styling then the stylesheet is your
answer. So you only want the first level list to have a marker. OK, then
set a rule for all descendant ULs to have a list-style of none.

ul ul { list-style: none; }
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top