Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CSS programming style - universal selector

Status
Not open for further replies.

JGH

Programmer
Feb 1, 2001
21
US
Okay, CSS isn't a programming language, but you get the idea... Today I was getting acquainted with the universal selector (*) in CSS, and was wondering what is approrpiate use/good programming style with this all powerful selector?

For instance, most of my sites use the same font-family for all elements (maybe one or two exceptions), and I could either set in the stylesheets something like:
Code:
BODY, TH, INPUT, etc. etc. { font-family:verdana }

or I could just do:
Code:
* { font-family:verdana }

and take a nap.

Any reason, stylistically, intuitively, or otherwise, why I shouldn't?

Thanks - Jim
 
When paired with the child selector, it's a useful CSS hack to hide things from IE:
Code:
[COLOR=red]*>[/color]foo {
  font-family: verdana;
}

---
Marcus
better questions get better answers - faq581-3339
accessible web design - zioncore.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top