What does an asterisk do in a CSS property name?

Css

Css Problem Overview


I know what an asterisk does in a selector for CSS (What does an Asterisk do?), but what does it do in a property name? Here is an example of CSS used by YUI. I don't know what the *display does.

.yui-button .first-child
{
    display:block;
    *display:inline-block;
}

Css Solutions


Solution 1 - Css

It is a syntax error. So in CSS, it makes the property name invalid and stops it being parsed.

Thanks to bugs in browsers, it is sometimes ignored. This effectively causes the property to apply only to browsers featuring that particular bug — IE7.

In general, it should be avoided in favour of conditional comments.

Solution 2 - Css

It's an IE hack. The second declaration will be applied by IE7 and older (thus overriding the first declaration), while other browsers will ignore it and continue applying the first declaration instead.

Also, this is invalid CSS syntax.

Solution 3 - Css

its like the underscore for ie6. but for ie7

if you put the asterisk the property will only be used in ie7 and older browsers.

its an hack...

Solution 4 - Css

It's one of the IE hacks. Internet Explorer parses CSS in a slightly different way, allowing for certain hacks that will be ignored in other browsers. Google for it. You can target different versions of IE with different hacks.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionAveryView Question on Stackoverflow
Solution 1 - CssQuentinView Answer on Stackoverflow
Solution 2 - CssBoltClockView Answer on Stackoverflow
Solution 3 - Cssguy schallerView Answer on Stackoverflow
Solution 4 - CssmingosView Answer on Stackoverflow