What does an underscore “_” mean in CSS?

前端 未结 3 508
梦如初夏
梦如初夏 2021-01-31 15:42

I just found the following snippet in a CSS file:

position: fixed;
_position: absolute;

What does this underline mean in front of the second

3条回答
  •  不思量自难忘°
    2021-01-31 16:05

    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.

提交回复
热议问题