|
Posted by rf on March 31, 2008, 2:20 am
Please log in for more thread options
>> > The following code doesn't work as I want, because the 2nd list
>> > doesn't appear as a "list" (no bullets) and requires the <br> after
>> > each
>> > item to appear as a vertical list of items.
>>
>> > li
>> > li.list {margin-left: 60px}
>>
>> Have a very carefull think about what the first of the above two rules
>> does.
>
> I did, and I tried to have 2 distinct "li" declarations: li.menu and
> li.list. When I did so, it destroyed the "li" that manipulates my
> horizontal menu at the top of the page (the "display:inline"
> declaration), and I wound up with a bulleted vertical list of the menu
> items. I couldn't figure out a way to declare 2 "li" types, and I had
> to revert to the posted code (which at least handles my menu list).
> <sigh>
Here is where a URL is mandatory for from the code you supply and the
description you give it should work. In other words: I don't believe you
:-)
li.menu {display: inline;} will *only* affect list items with class "menu".
> To respond to your answer, does it mean that the first rule applies
> to _all_ "li" rules - and that the second is a subset of it? If so, how
> _do_ I declare 2 separate and different rules for the "li"/"ul" sets
> that do different things (other than what I tried)? TIA
Yes, and the subset is those li's who specify class="list", but I would do
it differently:
<ul class=menu>
<li> ...
<li> ...
<ul class=list>
<li> ...
<li> ...
and then
.menu li {/* style rule for li elements inside anything with class "menu"*/
display: inline; ...}
.list li {/* style rule for li elements inside anything with class "list" */
...}
Saves lots of typing and bandwidth and is what selectors are designed for.
--
Richard.
|