HighDots Forums  

Assigning multiple keywords to define a style

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss Assigning multiple keywords to define a style in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Sandman
 
Posts: n/a

Default Assigning multiple keywords to define a style - 08-27-2004 , 04:15 AM






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 { ... }

Any way to do this?

--
Sandman[.net]

Reply With Quote
  #2  
Old   
Harlan Messinger
 
Posts: n/a

Default Re: Assigning multiple keywords to define a style - 08-27-2004 , 06:38 AM






Sandman <mr (AT) sandman (DOT) net> wrote:

Quote:
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.

Quote:
And

.menu .level1 .active .haschildren { ... }

No, define the style of each class independently.

--
Harlan Messinger
Remove the first dot from my e-mail address.
Veuillez ๔ter le premier point de mon adresse de courriel.


Reply With Quote
  #3  
Old   
Sandman
 
Posts: n/a

Default Re: Assigning multiple keywords to define a style - 08-28-2004 , 06:18 AM



In article <n57ui0l0fs8rtvmtson2mgiikdhgb3kuud (AT) 4ax (DOT) com>,
Harlan Messinger <hmessinger.removethis (AT) comcast (DOT) net> wrote:

Quote:
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

Quote:
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.

--
Sandman[.net]


Reply With Quote
  #4  
Old   
Harlan Messinger
 
Posts: n/a

Default Re: Assigning multiple keywords to define a style - 08-28-2004 , 06:52 AM



Sandman <mr (AT) sandman (DOT) net> wrote:

Quote:
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.
Oh, OK. I figured you just wanted to combine and cascade. Then remove
the spaces in your list of period-headed classes, as Brian suggested.

Quote:
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.

Quote:
But I am unsure if it was CSS or perhaps XLS. I don'tknow what it did though.

--
Harlan Messinger
Remove the first dot from my e-mail address.
Veuillez ๔ter le premier point de mon adresse de courriel.


Reply With Quote
  #5  
Old   
Sandman
 
Posts: n/a

Default Re: Assigning multiple keywords to define a style - 08-28-2004 , 07:55 AM



In article <10iuiolc5g70066 (AT) corp (DOT) supernews.com>,
Brian <usenet3 (AT) julietremblay (DOT) com.invalid> wrote:

Quote:
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 */
}
Yes, this seems to work - in Safari for Mac, but not for IE for PC... What are
the limitations of IE regarding this and can I work around them somehow and
reach the same result?

--
Sandman[.net]


Reply With Quote
  #6  
Old   
Sandman
 
Posts: n/a

Default Re: Assigning multiple keywords to define a style - 08-28-2004 , 04:49 PM



In article <75s0j0d96nkuh2dkn0rpuk3hb4863vc8dl (AT) 4ax (DOT) com>,
Harlan Messinger <hmessinger.removethis (AT) comcast (DOT) net> wrote:

Quote:
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.

--
Sandman[.net]


Reply With Quote
  #7  
Old   
Harlan Messinger
 
Posts: n/a

Default Re: Assigning multiple keywords to define a style - 08-28-2004 , 05:37 PM



Sandman <mr (AT) sandman (DOT) net> wrote:

Quote:
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.
??? You use it as in your example above, except with > instead of <,
and I already explained what it means. Everything about CSS selectors
is explained at

http://www.w3.org/TR/CSS2/selector.html

See section 5.1, Pattern Matching, on that page. But as I also said,
this is inapplicable to what you wanted to do: use multiple classes
for the same HTML element.

--
Harlan Messinger
Remove the first dot from my e-mail address.
Veuillez ๔ter le premier point de mon adresse de courriel.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.