查找 HTML 中的错误并将其高亮显示。
/* Empty Elements */
div:empty, span:empty, li:empty, p:empty, td:empty, th:empty
{ padding: 20px; border: 5px dotted yellow !important; }
/* Empty Attributes */
*[alt=""], *[title=""], *[class=""], *[id=""], a[href=""], a[href="#"]
{ border: 5px solid yellow !important; }
/* Deprecated Elements */
applet, basefont, center, dir, font, isindex, menu, s, strike, u
{ border: 5px dotted red !important; }
/* Deprecated Attributes */
*[background], *[bgcolor], *[clear], *[color], *[compact], *[noshade], *[nowrap], *[size], *[start],
*[bottommargin], *[leftmargin], *[rightmargin], *[topmargin], *[marginheight], *[marginwidth], *[alink], *[link], *[text], *[vlink],
*[align], *[valign],
*[hspace], *[vspace],
*[height], *[width],
ul[type], ol[type], li[type]
{ border: 5px solid red !important; }
/* Proposed Deprecated Elements */
input[type="button"], big, tt
{ border: 5px dotted #33FF00 !important; }
/* Proposed Deprecated Attributes */
*[border], a[target], table[cellpadding], table[cellspacing], *[name]
{ border: 5px solid #33FF00 !important; }
div:empty, span:empty,
li:empty, p:empty,
td:empty, th:empty {padding: 0.5em; background: yellow;}
*[style], font, center {outline: 5px solid red;}
*[class=""], *[id=""] {outline: 5px dotted red;}
img[alt=""] {border: 3px dotted red;}
img:not([alt]) {border: 5px solid red;}
img[title=""] {outline: 3px dotted fuchsia;}
img:not([title]) {outline: 5px solid fuchsia;}
table:not([summary]) {outline: 5px solid red;}
table[summary=""] {outline: 3px dotted red;}
th {border: 2px solid red;}
th[scope="col"], th[scope="row"] {border: none;}
a[href]:not([title]) {border: 5px solid red;}
a[title=""] {outline: 3px dotted red;}
a[href="#"] {background: lime;}
a[href=""] {background: fuchsia;}
您可以使用书签将上述内容中的诊断样式应用。
DiagCSS
我想知道这个 CSS 的用途是什么?
“已弃用” :) 对不起。
“已弃用” 更准确。
http://en.wikipedia.org/wiki/Deprecation
我不明白“name”属性怎么会很快被弃用。这就是表单在提交时发送到操作页面的内容。除非它更改为 ID,在这种情况下,表单将不得不发送该数据而不是“name”。
我也是。我也对此感到惊讶。
看不懂……这个…… :(
上面的 CSS 实际上只是为了调试旧的元素和属性!现在呢?
哈哈哈哈哈哈哈哈哈
我的网站是绿色的,我从未见过它如此红色!
这不可能是对的,哈哈
*去他的脸*
a[target]? 我不明白。我能想到的唯一替代方案是
document.getElementById(“URL”).target = “_blank”;
为什么要删除 target?
谢谢亲爱的先生
这段代码很有想象力,但先生请说明代码的输出。
仅在开发过程中在您的网页上使用提供的 CSS。
CSS 应该为您提供有关已弃用/损坏/错误的 HTML 实现的信息。
提醒一下,a[target] 现在不再弃用了。
来源:http://dev.w3.org/html5/markup/a.html
这太棒了!有没有机会获得 2016 年更新的规则集?