Solved

what "*"  means in css class

Posted on 2011-09-28
4
202 Views
Last Modified: 2012-08-13
I have copied an css file from an existing web page.

In the style sheet i have found this code

* {
    margin: 0;
    padding: 0;
}


I have no idea what this is for, could any one explain this to me.
0
Comment
Question by:ziorinfo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 39

Expert Comment

by:Pratima Pharande
ID: 36716542
This is the "star property hack" along the same lines as the "underscore hack." It includes junk before the property that IE ignores (the * works up to IE 7, the _ up to IE 6).


refer
http://stackoverflow.com/questions/1667531/what-does-a-star-preceded-property-mean-in-css

http://www.ejeliot.com/blog/63
0
 
LVL 17

Expert Comment

by:sonawanekiran
ID: 36716639
If you want to apply only to IE then use * preceded. In short it is just IE specific rule.
0
 
LVL 2

Accepted Solution

by:
WizardOfOgz earned 50 total points
ID: 36717633
This is NOT an example of star hack or an IE-specific rule.

* is the universal CSS selector which matches an element of any type.  See http://www.w3.org/TR/CSS2/selector.html#universal-selector

The rule you posted will be apply a 0 margin and padding to all elements.
0
 
LVL 2

Expert Comment

by:WizardOfOgz
ID: 36717645
If you are curious about the star hack that was mentioned and similar CSS hacks for IE you can read about them here
http://en.wikipedia.org/wiki/CSS_filter#Star_hack
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Unordered lists (HTML ul tags) are very handy to create menus of all types, shapes and sizes.  All it takes is a little knowledge of CSS and the possibilities are endless. First off, you should know the general format for menus created using the …
Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question