?
Solved

what "*"  means in css class

Posted on 2011-09-28
4
Medium Priority
?
204 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 200 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

CSS is a visual language used to classify objects and define rules about how they should be displayed. CSS skills aren’t restricted to developers anymore, there is a big benefit to having a basic understanding of the language, regardless of your occ…
This article discusses four methods for overlaying images in a container on a web page
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
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…
Suggested Courses
Course of the Month9 days, 13 hours left to enroll

762 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