![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I have a script that generates a hierarchical menu, but I am having problems assigning styles to each manu items different possible states. The possible states a menu item can be in is (and all of these can be combined unless they are mutually exclusive): 1. It can belong to a specific level in the hierarchy; 1, 2, 3 and so on. 2. It is the active menu 3. It is an inactive menu 4. It has children 5. It does not have children As you see, there are quite a lot of things a specific menu can belong to, such as: Menu item "Front page" may belong to level 1, be the active menu and have children - and should have an apparence that coprrespondes to this. Is there a way to assign multiple classes, or in any other way manage this parrticular menus look? In pseudo-code: div class="menu,level1,active,haschildren">Front Page</div |
|
And .menu .level1 .active .haschildren { ... } |
#3
| |||
| |||
|
|
I have a script that generates a hierarchical menu, but I am having problems assigning styles to each manu items different possible states. The possible states a menu item can be in is (and all of these can be combined unless they are mutually exclusive): 1. It can belong to a specific level in the hierarchy; 1, 2, 3 and so on. 2. It is the active menu 3. It is an inactive menu 4. It has children 5. It does not have children As you see, there are quite a lot of things a specific menu can belong to, such as: Menu item "Front page" may belong to level 1, be the active menu and have children - and should have an apparence that coprrespondes to this. Is there a way to assign multiple classes, or in any other way manage this parrticular menus look? In pseudo-code: div class="menu,level1,active,haschildren">Front Page</div Almost--separate the class names with spaces. |
|
And .menu .level1 .active .haschildren { ... } No, define the style of each class independently. |
#4
| |||
| |||
|
|
In article <n57ui0l0fs8rtvmtson2mgiikdhgb3kuud (AT) 4ax (DOT) com>, Harlan Messinger <hmessinger.removethis (AT) comcast (DOT) net> wrote: I have a script that generates a hierarchical menu, but I am having problems assigning styles to each manu items different possible states. The possible states a menu item can be in is (and all of these can be combined unless they are mutually exclusive): 1. It can belong to a specific level in the hierarchy; 1, 2, 3 and so on. 2. It is the active menu 3. It is an inactive menu 4. It has children 5. It does not have children As you see, there are quite a lot of things a specific menu can belong to, such as: Menu item "Front page" may belong to level 1, be the active menu and have children - and should have an apparence that coprrespondes to this. Is there a way to assign multiple classes, or in any other way manage this parrticular menus look? In pseudo-code: div class="menu,level1,active,haschildren">Front Page</div Almost--separate the class names with spaces. Ok And .menu .level1 .active .haschildren { ... } No, define the style of each class independently. No, that won't work. I want a specific style for that exact combination of styles. |
|
I once saw a style declarations that looked like this: .class < .otherclass { ... } |
|
But I am unsure if it was CSS or perhaps XLS. I don'tknow what it did though. |
#5
| |||
| |||
|
|
Sandman wrote: Is there a way to assign multiple classes, or in any other way manage this parrticular menus look? div class="menu,level1,active,haschildren">Front Page</div div class="menu level1 active haschildren">Front Page</div .menu .level1 .active .haschildren { ... } .menu.level1.active.haschildren { /* styles only for element that has _all_ of these classes */ } .menu { /* styles for any element that has class menu including the div as I wrote above */ } .active { /* styles for any element that has class active including the div as I wrote above */ } |
#6
| |||
| |||
|
|
I once saw a style declarations that looked like this: .class < .otherclass { ... } There isn't any E1 < E2. There's E1 > E2, which matches any element matching E2 that is a child (an immediate child, not a descendent) of an element matching E1. |
#7
| |||
| |||
|
|
In article <75s0j0d96nkuh2dkn0rpuk3hb4863vc8dl (AT) 4ax (DOT) com>, Harlan Messinger <hmessinger.removethis (AT) comcast (DOT) net> wrote: I once saw a style declarations that looked like this: .class < .otherclass { ... } There isn't any E1 < E2. There's E1 > E2, which matches any element matching E2 that is a child (an immediate child, not a descendent) of an element matching E1. Ok, could you elaborate? How do I use it and what are the rules for it - maybe you have a good reference URL for this. |
![]() |
| Thread Tools | |
| Display Modes | |
| |