Loading... Please wait...
   Home
Contact Code Collections | About Code Collections
  
 
             | 
X Sections
Code News RSS
Links
Developer Sites
License Types
CSS * Operator PDF Print E-mail
Written by Phillip Brown   
Thursday, 21 September 2006
CSS * Operator

After building 10 or so websites, and using CSS for quite a while I was becoming fairly competent with CSS.
As with all things no matter how much you know, there is always something else to learn. This is the case with programming anyway.

One day browsing around the net I come across the CSS * operator. I was surprised as I had spent lots of time reading and using CSS, but I had never come across it previously.
If you need to have the whole site follow a particular style or font size then you can enforce it with the * operator

The following snippet will apply the font Arial over the entire site, reguardless of any number of nestings of elements. This can overcome nesting issues when parts of your site apper to have a different font then the one you have selected when you have applied a style to an element.
language: css
  1. * {
  2. font-family: Arial, Helvetica, sans-serif;
  3. }

The following would set the font size for anything that is not explicitly set to 12px.

language: css
  1. * {
  2. font-size: 12px;
  3. }
Last Updated ( Monday, 06 November 2006 )
 
Page was generated in 0.037061 seconds