Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does an underscore "_" mean in CSS?

Tags:

css

People also ask

What does underscore mean in CSS?

This is a way to give alternative directives to WinIE browsers, since they don't support certain features of the latest CSS definitions. Other browsers will ignore the whole definition (e.g. _position: relative), while WinIE will treat it as position: relative. Follow this answer to receive notifications.

How do you use underscore in CSS?

Underscores require hitting the Shift key, and are therefore harder to type. CSS selectors which are part of the official CSS specifications use dashes (such as pseudo-classes like :first-child and pseudo-elements :first-line), not underscores. Same thing for properties, e.g. text-decoration, background-color, etc.

What does double underscore mean in CSS?

Double Underscore is used to define sub element of a block.

How do you underscore in HTML?

HTML <u> and CSS The ASCII underscore character can be inserted with the entities &lowbar; or &UnderBar; (or &#95; or &#x5F; ).


It's one of a number of CSS "hacks" used to target specific versions of Internet Explorer.

selector {
    property: value;   /* all browsers */
    property: value\9; /* < IE9 */
    *property: value;  /* < IE8 */
    _property: value;  /* < IE7 */
}

Generally speaking you should avoid CSS hacks in favor of conditional classes on HTML.


This is an old CSS-Hack for IE5, 5.5 & 6.
All browser will display the position:fixed while IE5 - 6 use the _position, so it display it absolute.

But note: This CSS won't validate! And it won't work for IE5/MAC


This is a way to give alternative directives to WinIE browsers, since they don't support certain features of the latest CSS definitions. Other browsers will ignore the whole definition (e.g. _position: relative), while WinIE will treat it as position: relative.