css Question using asterisk

M

mark | r

when using an asterisk * can you single out a tag where it doesnt apply i.e.
(everything but not #menu)

someones said you put the NOT element behind the * i.e.

* #fred{}

meaning everything but not #fred

only it doesnt seem to work?

any tips
 
L

Leif K-Brooks

mark said:
when using an asterisk * can you single out a tag where it doesnt apply i.e.
(everything but not #menu)

Your best bet is to cancel out the styles for * in a style for #menu,
like this:

* {
color: red;
background: black;
}

#foo {
color: inherit;
background: inherit;
}
 
S

Steve Pugh

mark | r said:
when using an asterisk * can you single out a tag where it doesnt apply i.e.
(everything but not #menu)

Not in CSS 2.1, but in CSS 3 the following is possible:
#:not(#menu) {}
http://www.w3.org/TR/2001/CR-css3-selectors-20011113/#negation

Whether any browsers support this yet is another matter.
someones said you put the NOT element behind the * i.e.

* #fred{}

meaning everything but not #fred

only it doesnt seem to work?

That selects all elements with id of fred that are descendents of any
element. In other words that is almost exactly the same as just
writing #fred {}

Steve
 

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

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top