Solved

what "*"  means in css class

Posted on 2011-09-28
4
203 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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

Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …

688 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