好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

CSS3有关特性查询功能的讲解介绍

这是2017年不能不了解和学习的一个CSS新特性,非常实用,考虑到现实世界浏览器的复杂性,该特性本应该先于其他新特性出来。

@supports <supports-condition> {
  <group-rule-body>
} 
@supports ( display: flex ) {
    .foo { display: flex; }
} 
@supports (display: table-cell) and (display: list-item) {
    … /* your styles */
}
 
@supports not ((text-align-last:justify) or (-moz-text-align-last:justify) ){
    … /* 不支持justify时,用这里的代码来模拟text-align-last:justify */
} 
@supports (animation-name: test) {
    … /* 当UA支持无前缀animations特性时的特定样式 */
    @keyframes { /* @supports 作为一个CSS条件组at-rule,可以包含其他at-rules */
      …    
    }
} 
@supports (--foo: green) {
  body {
    color: green;
  }
} 

规范状态

尚处于候选推荐CR(Candidate Recommendation)状态,规范链接:CSS Conditional Rules Module Level 3.

浏览器兼容性

桌面系统:

移动设备:

以上就是CSS3有关特性查询功能的讲解介绍的详细内容,更多请关注Gxl网其它相关文章!

查看更多关于CSS3有关特性查询功能的讲解介绍的详细内容...

  阅读:49次