CSS验证程序无法识别CSS指针事件和外观属性 [英] CSS pointer-events and appearance properties not recognized by CSS Validator

查看:110
本文介绍了CSS验证程序无法识别CSS指针事件和外观属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I'm new in CSS and just built an app. The problem is, when validating CSS I get the following errors and warnings:

有人可以解释这些错误和警告的含义是什么,以及如何修正它以便可以验证CSS吗?

Can somebody please explain what these errors and warnings mean and how to fix it so that the CSS could be validated?

尽管有这些错误,我的应用仍能正常运行.

My app is functioning normally despite those errors.

这是我的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, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, 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验证器,后者需要属性和值才能获得较高的官方地位,然后才能被纳入.您经常会发现属性和值太新或尚未开发,无法包含在验证器中,但仍受主要浏览器的支持.

TL;DR: Focus more on the data in caniuse.com, which tells you what browsers are actually doing, as opposed to W3C validators, which require properties and values to achieve a high official status before being included. You'll often find properties and values that are too new or undeveloped for inclusion in the validators, but are nonetheless supported by major browsers.

来自CSS工作组档案:

From CSS Working Group archives:

我刚刚使用CSS验证程序检查了页面 redseen.3owl.com .

我收到此错误:

属性指针事件不存在:无

为什么这显示为错误?

因为当前没有CSS规范定义指针事件 财产.它在SVG 1.1中定义,但在 非SVG元素的CSS是实验性的.该功能曾经是一部分 的CSS3 UI规范草案,但由于存在许多未解决的问题, 被推迟到CSS4.

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.

W3C CSS验证程序通常以CSS3模式检查模糊性 包含CSS 2.1和选定的"CSS3"的文档集合 规范",不包括许多仍处于工作草案级别的规范 -并且指针事件即使在WD级别(或据我所知甚至在编辑草稿中)也尚未定义.

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).

http://lists.w3.org/Archives/Public/www-validator-css/2012Nov/0033.html

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

The excerpt above is from 2012. But it is still valid in 2017.

来自 MDN pointer-events :

[pointer-events]对HTML元素的扩展,尽管在CSS的早期草稿中存在 基本用户界面模块3级,已推至4级.

[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 appearance属性似乎处于相同情况( MDN ).当前处于编辑器的草稿"状态,因此未包含在CSS验证器中.

The CSS appearance property appears to be in the same situation (MDN). It's currently in Editor's Draft status and, therefore, not included in the CSS Validator.

在我开发的所有网站中,验证HTML总是比CSS容易.实际上,虽然大多数时候我可以实现完整的HTML验证,但我认为我从未实现完整的CSS验证.

In all sites I've developed it was always easier to validate HTML than CSS. In fact, while most of the time I can achieve full HTML validation, I don't think I've ever achieved full CSS validation.

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

This is because I use properties that are supported by most browsers, but are not always at validator threshold status in the standardization process.

由于这个原因,除了一般信息之外,我不使用CSS验证程序.我建议您不要让CSS验证错误阻止您前进.

For this reason, I don't use the CSS validator for anything more than general information. I would suggest you don't let CSS validation errors stop you from moving forward.

> caniuse.com 网站上关注更多内容,以检查浏览器对CSS属性的支持.您会发现,尽管pointer-events属性不在当前的CSS规范中,但一段时间以来大多数主流浏览器都支持它.

Focus more on the caniuse.com website to check browser support for CSS properties. You'll find that the pointer-events property, despite not being in a current CSS spec, has been supported by most major browsers for some time now.

这篇关于CSS验证程序无法识别CSS指针事件和外观属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆