Is there a way to set any style for a specific browser in CSS?

后端 未结 3 1186
孤独总比滥情好
孤独总比滥情好 2020-12-29 10:35

For example, if I want to set the corner radius in Webkit, Firefox and other than I can use the following CSS:

-webkit-border-radius: 8px;
-moz-border-radi         


        
3条回答
  •  生来不讨喜
    2020-12-29 11:05

    For example, if I want to set the corner radius in Webkit, Firefox and other than I can use the following CSS

    No, that isn't how it works.

    Vendor prefixed properties are used for experimental features. Either because the specification for the property hasn't been locked down or because the browser implementor knows their are problems with the implementation.

    In general, you shouldn't use them in production code because they are experimental.

    Support for the vendor prefixed versions is removed as support stabilises.

    Is there a way to set any style for a specific browser in CSS?

    There are several methods that have been used for that effect.

    Parser bugs

    By exploiting bugs or unsupported features in specific CSS engines (e.g. some versions of IE will ignore a * character on the front of a property name while other browsers will (correctly) discard the entire rule).

    Conditional comments

    Older versions of Internet Explorer supported an extended HTML comment syntax that could be used to add or