Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does an asterisk do in a CSS property name? [duplicate]

Tags:

css

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; } 
like image 890
Avery Avatar asked Dec 30 '10 15:12

Avery


People also ask

What does the asterisk mean in CSS?

The Universal Selector is the * in CSS. Literally the asterisk character. It is essentially a type selector that matches any type. Type meaning an HTML tag like <div> , <body> , <button> , or literally any of the others. A common use is in the universal reset, like this: * { margin: 0; padding: 0; }

What is the asterisk selector?

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.


1 Answers

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.

like image 97
Quentin Avatar answered Sep 21 '22 19:09

Quentin