Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/34.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 如何防止W3C验证程序解析内部CSS?_Html_Css_Validation_W3c Validation - Fatal编程技术网

Html 如何防止W3C验证程序解析内部CSS?

Html 如何防止W3C验证程序解析内部CSS?,html,css,validation,w3c-validation,Html,Css,Validation,W3c Validation,用户并不总是解析内部CSS。我知道这一点是因为,就在最近,以前没有错误和警告的页面现在发现了新的CSS错误 因此,我的问题是:W3C验证器是否存在类似于 对于谷歌来说,阻止W3C解析内部CSS 示例“内部”CSS代码: <style> @-ms-viewport { width:device-width; } button, input[type="button"], input[type="submit"], input[type="rese

用户并不总是解析内部CSS。我知道这一点是因为,就在最近,以前没有错误和警告的页面现在发现了新的CSS错误

因此,我的问题是:W3C验证器是否存在类似于

对于谷歌来说,阻止W3C解析内部CSS

示例“内部”CSS代码:

<style> 

@-ms-viewport
    {
        width:device-width;
    }

button, input[type="button"], input[type="submit"], input[type="reset"]
    {
        padding-top:8px !important;
        padding-right:14px !important;
        padding-bottom:9px !important;
        padding-left:14px !important;

        -webkit-box-sizing:border-box;
        -moz-box-sizing:border-box;
        box-sizing:border-box;

        -moz-box-shadow:0px 1px 2px rgba(159,159,159,0.5);
        -webkit-box-shadow:0px 1px 2px rgba(159,159,159,0.5);
        -khtml-box-shadow:0px 1px 2px rgba(159,159,159,0.5);
        box-shadow:0px 1px 2px rgba(159,159,159,0.5);

        -webkit-border-radius:2px;
        -moz-border-radius:2px;
        -khtml-border-radius:2px;
        border-radius:2px;

        border-width:1px;
        border-style:solid;
        border-color:#BCBCBC;

        background:#f0f0f0;
        background:-moz-linear-gradient(top, #f0f0f0 0%, #E0E0E0 100%);
        background:-webkit-gradient(linear, left top, left bottom, color-stop(0%,#f0f0f0), color-stop(100%,#E0E0E0));
        background:-webkit-linear-gradient(top, #f0f0f0 0%,#E0E0E0 100%);
        background:-o-linear-gradient(top, #f0f0f0 0%,#E0E0E0 100%);
        background:-ms-linear-gradient(top, #f0f0f0 0%,#E0E0E0 100%);
        background:linear-gradient(to bottom, #f0f0f0 0%,#E0E0E0 100%);
        filter:progid:DXImageTransform.Microsoft.gradient( startColorstr='#f0f0f0', endColorstr='#E0E0E0',GradientType=0 );

        color:#535353 !important;
        font-size:0.928em !important;
        font-weight:normal !important;
        line-height:normal !important;
    }

button:hover, input[type="button"]:hover, input[type="submit"]:hover, input[type="reset"]:hover, button:focus, input[type="button"]:focus, input[type="submit"]:focus, input[type="reset"]:focus
    {
        background:#f8f8f8;
        background:-moz-linear-gradient(top, #f8f8f8 0%, #E1E1E1 100%);
        background:-webkit-gradient(linear, left top, left bottom, color-stop(0%,#f8f8f8), color-stop(100%,#E1E1E1));
        background:-webkit-linear-gradient(top, #f8f8f8 0%,#E1E1E1 100%);
        background:-o-linear-gradient(top, #f8f8f8 0%,#E1E1E1 100%);
        background:-ms-linear-gradient(top, #f8f8f8 0%,#E1E1E1 100%);
        background:linear-gradient(to bottom, #f8f8f8 0%,#E1E1E1 100%);
        filter:progid:DXImageTransform.Microsoft.gradient( startColorstr='#f8f8f8', endColorstr='#E1E1E1',GradientType=0 );
    }

button:active, input[type="button"]:active, input[type="submit"]:active, input[type="reset"]:active
    {
        -moz-box-shadow:inset 0px 1px 2px rgba(205,205,205,1);
        -webkit-box-shadow:inset 0px 1px 2px rgba(205,205,205,1);
        -khtml-box-shadow:inset 0px 1px 2px rgba(205,205,205,1);
        box-shadow:inset 0px 1px 2px rgba(205,205,205,1);

        background:#E0E0E0;

        text-decoration:none !important;
    }

</style>

@-ms视口
{
宽度:设备宽度;
}
按钮,输入[type=“button”],输入[type=“submit”],输入[type=“reset”]
{
填充顶部:8px!重要;
右边填充:14px!重要;
填充底部:9px!重要;
左侧填充:14px!重要;
-webkit框大小:边框框;
-moz框大小:边框框;
框大小:边框框;
-moz盒阴影:0px 1px 2px rgba(159,0.5);
-webkit盒阴影:0px 1px 2px rgba(159,0.5);
-khtml盒影:0px 1px 2px rgba(159,0.5);
盒影:0px 1px 2px rgba(159159,0.5);
-webkit边界半径:2px;
-moz边界半径:2px;
-khtml边界半径:2px;
边界半径:2px;
边框宽度:1px;
边框样式:实心;
边框颜色:#bcbc;
背景:#f0;
背景:-moz线性梯度(顶部,#F00%,#E0100%);
背景:-webkit渐变(线性、左上、左下、颜色停止(0%、#F0F0)、颜色停止(100%、#E0));
背景:-webkit线性梯度(顶部,#F00%,#E0100%);
背景:-o-线性梯度(顶部,#F00%,#E0100%);
背景:-ms线性梯度(顶部,#F00%,#E0100%);
背景:线性梯度(至底部,#F00%,#E0100%);
过滤器:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f0f0',endColorstr='#e0e0',GradientType=0);
颜色:#5353!重要;
字体大小:0.928em!重要;
字体大小:正常!重要;
线高:正常!重要;
}
按钮:悬停,输入[type=“button”]:悬停,输入[type=“submit”]:悬停,输入[type=“reset”]:悬停,按钮:焦点,输入[type=“button”]:焦点,输入[type=“submit”]:焦点,输入[type=“reset”]:焦点
{
背景:#f8f8;
背景:-莫兹线性梯度(顶部,#F80%,#E1E1100%);
背景:-webkit渐变(线性、左上、左下、颜色停止(0%、#F8F8)、颜色停止(100%、#E1E1));
背景:-webkit线性梯度(顶部,#F80%,#E1E1100%);
背景:-o-线性梯度(顶部,#F80%,#E1E1E1 100%);
背景:-ms线性梯度(顶部,#F80%,#E1E1100%);
背景:线性梯度(到底部,#F80%,#E1E1100%);
过滤器:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f8f8',endColorstr='#e1e1e1e1',GradientType=0);
}
按钮:激活,输入[type=“button”]:激活,输入[type=“submit”]:激活,输入[type=“reset”]:激活
{
-moz盒阴影:嵌入0px 1px 2px rgba(205205205,1);
-webkit盒阴影:嵌入0px 1px 2px rgba(205205205205,1);
-khtml盒影:嵌入0px 1px 2px rgba(205205205,1);
盒影:插入0px 1px 2px rgba(205205205,1);
背景:#e0;
文字装饰:无!重要;
}

使用检查HTML5文档时,您将被重定向到,因此后者可能是您正在使用的验证器

WHATWG的HTML规范对以下内容的要求:

样式
元素的

这意味着:如果您想要一个有效的WHATWG-HTML文档,那么
style
元素中的CSS也必须有效。
以前不是这样

但是,截至2017年12月26日,W3C的HTML规范对的没有此要求。除非W3C-HTML文档也添加了这一要求,否则即使它们在
style
元素中包含无效的CSS,W3C-HTML文档仍然是有效的。那么W3C托管的验证器实例可能会禁用这个CSS检查功能


(几天前,一位用户。维护人员“将对此进行调查”。

您能提供一个给出此类错误的最小示例吗?我尝试了几种方法,但无法复制。@unor我只是添加了它。对不起,等了这么久,我最近一直忙着工作。所以我已经有一段时间没回来了。谢谢你的邀请!谢谢,我可以用复制,但不能用。您是否正在使用Nu验证程序(即检查HTML5)?@unor我不确定,因为我通常在网页上包含一个自动检查有效性的链接(例如
)。我通常不会直接到w3验证程序站点手动检查页面。我可以将用于验证的链接前缀更改为其他内容吗?