Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does an * (star) mean in front of a CSS declaration? [duplicate]

Tags:

css

I'm using the Yahoo YUI libraries in a project. Can anyone help me understand the following CSS that I came across in the layout manager CSS:

I have been unable to figure out what the * (star) does to the declarations in the following CSS:

.yui-skin-sam .yui-layout .yui-layout-unit div.yui-layout-bd {
border:1px solid #808080;
border-bottom:none;
border-top:none;
*border-bottom-width:0;
*border-top-width:0;
background-color:#f2f2f2;
text-align:left;
}
like image 261
Bill Caswell Avatar asked Apr 02 '10 04:04

Bill Caswell


People also ask

What is * in beginning of CSS file?

The asterisk (*) is known as the CSS universal selectors. It can be used to select any and all types of elements in an HTML page. The asterisk can also be followed by a selector while using to select a child object. This selector is useful when we want to select all the elements on the page.

What does a star mean in CSS?

An asterisk ( i.e. "*" ) is used to denote a CSS universal selector. An asterisk can also be followed by a selector. This is useful when you want to set a style for of all the elements of an HTML page or for all of the elements within an element of an HTML page.


2 Answers

This is a hack to apply styles only to older versions of IE the * declared styles will override the new style elements , that are unsuported by Od IE only. http://en.wikipedia.org/wiki/CSS_filter#Star_hack

like image 72
Michael Avatar answered Sep 30 '22 14:09

Michael


The star exploits a bug in version 7 and below of Internet Explorer and is used to make IE render your markup correctly. More information here: http://www.ejeliot.com/blog/63

like image 3
Hussein Abbas Avatar answered Sep 28 '22 14:09

Hussein Abbas