how to get the css version

前端 未结 5 1676
情歌与酒
情歌与酒 2020-12-31 03:19

How do i get the version of CSS that I am using?

相关标签:
5条回答
  • 2020-12-31 03:55

    As far as I know there's nothing in CSS code that specifies the version. Browsers are designed to interpret one or more versions of CSS at runtime. Therefore, I would imagine that you would need to get the verion of the browser via javascript and then determine what version of CSS is understood by the browser.

    0 讨论(0)
  • 2020-12-31 04:04

    In my opinion you should use object detection instead - check the MDC to understand the principle.
    On Internet Explorer you might find compatMode and documentMode useful.

    0 讨论(0)
  • 2020-12-31 04:05

    The version is only defined by the CSS selectors, propreties and attributes that you use.

    You are free to mix elements of CSS 1, 2 and 3 in any styles that you write.

    You can refer to the CSS specifications to see more details. The specifications and drafts at the W3C is available via this index: http://www.w3schools.com/w3c/w3c_css.asp

    0 讨论(0)
  • 2020-12-31 04:13

    Although the CSS specification is defined in several versions (v2, 2.1, 3), the CSS version isn't really relevant to the developer; you need to be more concerned with which web browsers support a given feature.

    It is useful to know that a given feature was defined in CSS2, 2.1 or 3 because that can give you an idea of how old the feature is, and therefore how likely it is that browsers will support it -- for example border-radius is a CSS3 feature, so browsers more than a couple of years old may not support it fully.

    You can find out what CSS features are supported in which browsers from the following sites:

    • http://www.quirksmode.org/css/contents.html
    • http://caniuse.com/

    Hope that helps.

    0 讨论(0)
  • 2020-12-31 04:18

    Just an addition of what @Craig said.

    In my .net 2.0 framework I have a property to show scroll bars. As I want just the vertical, I've added both properties and, if the browser that user is using support this new CSS 3.0 property (overflow-x), he will see just the vertical one.

    enter image description here

    0 讨论(0)
提交回复
热议问题