Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS wildcards in attributes

Tags:

html

css

I ran accross this:

#id {
    width: 73.076em;
    *width: 71.25em;
}

What does the wildcard mean? I can't seem to quickly google my way out of this.

like image 277
slezica Avatar asked Jul 15 '11 19:07

slezica


People also ask

What is use of * in CSS?

The asterisk (*), also known as the CSS universal selector, is used to select all items in an HTML file. CSS selectors are used to select the sections of your web page you wish to style.

What is the purpose of * wildcard in a selection?

A wildcard character is used to substitute one or more characters in a string. Wildcard characters are used with the LIKE operator. The LIKE operator is used in a WHERE clause to search for a specified pattern in a column.

What are CSS attributes?

CSS attributes are properties that influence the styling and layout of HTML elements. Each property controls a small part of the overall style.


2 Answers

The * rule IS ONLY picked up by Internet Explorer.. It's a CSS hack.

*property: value applies the property value in IE 7 and below. It may or may not work in future versions. Warning: this uses invalid CSS.

like image 97
Phil Avatar answered Sep 19 '22 02:09

Phil


@Phil is correct - *property: value is a CSS hack that will only be applied in IE7 and lower.

I'd like to link to this article: http://mathiasbynens.be/notes/safe-css-hacks#css-hacks

Both the _property: value and *property: value hacks (as seen in the above code block) are examples of safe CSS hacks. They were discovered, identified as bugs, and patched in a browser update. Since then, it’s very likely that Microsoft and other browser vendors added checks for these CSS hacks to their layout tests, to make sure no new browser version is shipped with a regression this significant.

like image 38
thirtydot Avatar answered Sep 22 '22 02:09

thirtydot