CSS Validator无法识别CSS指针事件和外观属性

我是CSS的新手,只是构建了一个应用程序.问题是,在验证CSS时,我收到以下错误和警告:

有人可以解释这些错误和警告的含义以及如何修复它以便CSS可以被验证吗?

尽管存在这些错误,我的应用程序仍能正

这是我的CSS代码:

/*----------------------------CSS reset------------------------------*/

html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video {
    margin: 0;
    padding: 0;
    border: 0;
    font-size: 100%;
    font: inherit;
    vertical-align: baseline;
}


/* HTML5 display-role reset for older browsers */

article,section {
    display: block;
}

body {
    line-height: 1;
}

ol,ul {
    list-style: none;
}

blockquote,q {
    quotes: none;
}

blockquote:before,blockquote:after,q:before,q:after {
    content: '';
    content: none;
}

table {
    border-collapse: collapse;
    border-spacing: 0;
}

/*-----------App wrapper-----------*/
#wrapper {
  padding-left: 1em;
  padding-right: 1em;
}

/*-----------App description-----------*/

h1 {
  font-size: 24px;
  font-family: helvetica;
  font-weight: bold;
  text-align: center;
  padding-top: 1em;
  padding-bottom: 1em;
}

p {
  font-size: 16px;
  font-family: helvetica;
  text-align:justify;
  line-height: 1.2;
}
/*-----------Select menu-----------*/

#input {
  padding-top: 1em;
  padding-bottom: 1em;
}

#search_button,label select {
  padding: 10px 10px 10px 10px;
    background: #f8f8f8;
    color: #444;
    border: 1px solid black;
    border-radius: 0;
    display: inline-block;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    cursor: pointer;
    outline: none;
  font-family: helvetica;
  font-size: 13px;
}

#search_button,label select:-moz-focusring {
    color: transparent;
    text-shadow: 0 0 0 #444;
}

#search_button,label select::-ms-expand {
    display: none;
}

label:before {
    content: '';
    right: 5px;
    top: -7px;
    width: 30px;
    height: 33px;
    background: #f8f8f8;
    position: absolute;
    pointer-events: none;
    display: block;
}

label { position: relative; }

label:after {
    content: '>';
    font: 16px helvetica,monospace;
    color: #444;
    -webkit-transform: rotate(90deg);
    -moz-transform: rotate(90deg);
    -ms-transform: rotate(90deg);
    transform: rotate(90deg);
    right: 2px;
    top: -3px;
    border-bottom: 1px solid #aaa;
    position: absolute;
    pointer-events: none;
    width: 35px;
    padding: 0 0 5px 0;
    text-indent: 14px;
}

/*-----------Crest,Name-----------*/
#output {
  display: -webkit-box;      /* OLD - iOS 6-,Safari 3.1-6 */
  display: -moz-box;         /* OLD - Firefox 19- (buggy but mostly works) */
  display: -ms-flexbox;      /* TWEENER - IE 10 */
  display: -webkit-flex;     /* NEW - Chrome */
  display:flex;
  max-height: 70px;
}

#crest {
  max-height: 70px;
  max-width: 70px;
}

img {
  max-height: 100%;
  float: left;
}

#team-name {
  width: 100%;
}

h2 {
  font-size: 17px;
  font-family: helvetica;
  font-weight: bold;
  text-align: center;
  vertical-align: middle;
  line-height: 70px;
}

/*-----------Geochart container-----------*/


/*-----------Pie chart container-----------*/
  #pie-container {
      display: block;
  }
/*----------------------------Tablet responsive----------------------------*/
@media all and (min-width: 700px) {



  /*-----------App decription-----------*/
  h1 {
    font-size: 50px;
  }

  p {
    font-size: 16px;
  }

  /*-----------Crest,Name-----------*/
  #output {
    max-height: 120px;
  }

  #crest {
    max-height: 120px;
    max-width: 120px;
  }


  h2 {
    font-size: 38px;
    line-height: 120px;
  }
}
/*----------------------------Desktop responsive----------------------------*/

@media all and (min-width: 900px) {

  /*-----------App wrapper-----------*/
  #wrapper {
    padding-left: 5em;
    padding-right: 5em;
  }

  /*-----------App decription-----------*/

  h1 {
    font-size: 60px;
  }

  p {
    font-size: 18px;

  }

  /*-----------Crest,Name-----------*/
  #output {
    max-height: 160px;
  }

  #crest {
    max-height: 160px;
    max-width: 160px;
  }


  h2 {
    font-size: 40px;
    line-height: 160px;
  }

  /*-----------Pie chart container-----------*/
    #pie-container {
      display: -webkit-box;      /* OLD - iOS 6-,Safari 3.1-6 */
      display: -moz-box;         /* OLD - Firefox 19- (buggy but mostly works) */
      display: -ms-flexbox;      /* TWEENER - IE 10 */
      display: -webkit-flex;     /* NEW - Chrome */
      display:flex;
    }
    #countryPie {
        flex: 1;
    }
    #playerPie {
        flex: 1;
    }
}

谢谢你的帮助!

解决方法

TL; DR:更多地关注 caniuse.com中的数据,它告诉您浏览器实际在做什么,而不是W3C验证器,它需要属性和值才能在被包含之前达到高官方状态.您经常会找到太新或未开发的属性和值以包含在验证器中,但仍然受到主流浏览器的支持.

来自CSS工作组档案:

I just checked my page redseen.3owl.com with the css validator.

I got this error:

Property pointer-events doesn’t exist : none

Why is this shown as an error?

Because no CSS specifications currently define the pointer-events
property. It is defined in SVG 1.1,but the use of pointer-events in
CSS for non-SVG elements is experimental. The feature used to be part
of the CSS3 UI draft specification but,due to many open issues,has
been postponed to CSS4.

The W3C CSS Validator generally checks,in CSS3 mode,against a vague
collection of documents,consisting of CSS 2.1 and selected “CSS3
specifications”,excluding many that are still at Working Draft level
– and pointer-events isn’t currently defined even at WD level (or even in an Editor’s Draft,as far as I can see).

07001

上面的摘录是从2012年开始的.但它在2017年仍然有效.

MDN pointer-events

[The pointer-events] extension to HTML elements,though present in early drafts of CSS
Basic User Interface Module Level 3,has been pushed to its level 4.

CSS外观属性似乎处于相同的情况(MDN).它目前处于Editor’s Draft状态,因此不包含在CSS Validator中.

旁注

在我开发的所有网站中,验证HTML比使用CSS更容易.事实上,虽然大多数时候我可以实现完整的HTML验证,但我认为我没有实现完整的CSS验证.

这是因为我使用大多数浏览器支持的属性,但在标准化过程中并不总是处于验证器阈值状态.

因此,除了一般信息之外,我不会使用CSS验证器.我建议你不要让CSS验证错误阻止你前进.

更多关注caniuse.com网站,以检查浏览器对CSS属性的支持.您会发现指针事件属性(尽管不属于当前的CSS规范)已经被大多数主流浏览器支持了一段时间.

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


Css常用的排序方式权重分配 排序方式: 1、按类型 如,显示和浮动、定位、尺寸、字体等 2、按字母 按字母顺序排列,优点是规则简单 3、按定义长度 按照样式定义的字符长度排列 各有优劣,实际应用中,推荐使用第一种。 但是如果单靠前端工程师在编写过程中这么做的
原文:https://www.cnblogs.com/wenruo/p/9732704.html 先上效果 基本是用CSS实现的,没有用图片,加一丢丢JS。不过没有考虑太多兼容性。 首先画一个 <!DOCTYPE html><html lang="en">
css属性:word-wrap:break-word; 与 word-break:break-all 的用法; zhangq0123 于 2016-10-19 11:06:12 发布 6475 收藏 9分类专栏: CSS HTML 文章标签: html css版权 CSS同时被 2 个专栏收录8 篇
https://destiny001.gitee.io/color/
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> &l
css之background的cover和contain的缩放背景图 对于这两个属性,官网是这样解释的: contain 此时会保持图像的纵横比并将图像缩放成将适合背景定位区域的最大大小。 等比例缩放图象到垂直或者水平其中一项填满区域。 cover 此时会保持图像的纵横比并将图像缩放成将完全覆盖背景
.CSS.MAP文件作用 https://blog.csdn.net/qq_36441169/article/details/102575563 1、简介在写前端代码,使用bootstrap时,发现同一个目录下,不仅仅有.css文件的同时,还存在.css.map文件的存在。在前端页面调试时也发现,映
Jquery mobile 写html时文字太长无法自动换行。 Jquery mobile 1 篇文章0 订阅 订阅专栏 加上这个 style="word-wrap:break-word;word-break:break-all;" 或者 style="word-wra
详见:http://www.shagua.wiki/project/3 layui图标:http://www.shagua.wiki/project/3?p=85 JQ手册 :https://www.jc2182.com/jquery/jquery-jiaocheng.html css样式手册:ht
css里面圆形的代码,如何使用纯css实现圆形图像或叶子图像?(代码实例) 网易美学于 2021-08-03 22:15:22 发布946 收藏 文章标签: css里面圆形的代码 有没有想过如何制作那些各式各样的圆形图像而无需用ps,本篇文章就来给你介绍一下如
css文字超出一行就显示省略号 1,css超出一行用点表示 white-space:nowrap; overflow:hidden; text-overflow:ellipsis; 2,css超出二行用点表示 overflow:hidden; text-overflow:ellipsis; disp
js动态追加数据单独设置某一个元素的样式。 在开发时,我们有很多数据是从后台获取然后展示的,例如列表,最近开发碰到个需求是获取到列表信息之后,不仅仅是拼接展示出来,还需要将其中的第一个li元素设置成其他的样式类,在网上找了一堆的办法都和自身业务需求不一致,没办法自己通过chrome控制台一点点调试,
css3手机端h5商品列表页,两列等分排列技巧 .picture_list {	width: 100%;	overflow: hidden}.picture_list>li {	width: 50%; min-height: 120px;	float: left;	padding: 0px 3
css3 transform:scale(x)实现字体的缩放: css3 transform:scale(x)字体的缩放: transform:scale(x),针对于整体的缩放,缩放的整体包括宽,高,背景。这自然对于内联元素就无法使用此属性,最好使用无属性的span转换成块元素或者行内块元素进行设
jq获取第一个子元素并添加class <div class="main"> <div class="tit">颜色</div> <ul> <li>银色</li> <li>深灰色
设置背景图片的两种方式,并解决手机端背景图片高度自适应问题 赵世婷 2017-09-19 15:59:43 14372 收藏 5 1 设置背景图片的两种方式: 方式一: .back{undefinedposition: fixed;width: 100%;height: 100%
css层级选择器理论{#ek) E:first-child : 匹配的是E元素,E元素是父元素的第一个子元素 说明:利用 :first-child 这个伪类,只有当元素是另一个元素的第一个子元素时才能匹配。例如,p:first-child 会选择作为另外某个元素第一个子元素的所有 p 元素。一般可能
Css多行字符截取方法详解 时间:2021-07-01 10:21:17 相信有很多同学在写前端页面的时候,都会遇到字符长了需要截取的问题,最简单的方法就是手动去截取,可这样又感觉太low了,今天晚上就来讲讲利用css进行字符的截取,不了解css是如何截取的同学可以和我们一起看看哦! 前言 最近在做
css中content可以用到的字符编码 项目中用到的一些特殊字符和图标 html代码 <div class="cross"></div> css代码.cross{width: 20px;height: 20px;border-radius: 10px;b
CSS 计算属性 calc()的完整指南(上) 2020-05-03 CSS tricks上有一系列的完整指南文章,我后面会翻译这些内容,更新不会一下子完成,而是会分成几个,防止自己因看到文章过长而放弃翻译,一步一个脚印。 CSS有一个特殊的calc()函数,用于做基本的数学运算。下面是一个例子: