Skip to content

Instantly share code, notes, and snippets.

@flying19880517
Last active October 4, 2015 07:47
Show Gist options
  • Save flying19880517/2603342 to your computer and use it in GitHub Desktop.
Save flying19880517/2603342 to your computer and use it in GitHub Desktop.
调试样式 1px红色点线:行内样式 3px红色点线:空属性 5px蓝色点线:没有高和宽的图片 5px红色点线:没有alt的图片 黄色背景:空元素 绿色实线:过时属性 10px红框:过时元素 http://www.swordair.com/blog/2012/04/889/
/**
* Debug CSS by iifksp
* Author: iifksp@swordair.com
* Author URI: http://www.swordair.com/blog
* Version: 1.1
* License: MIT
*/
/* inline style */
*[style]{outline:1px dotted #f00 !important;}
/* empty attributes */
*[alt=""],*[title=""],*[class=""],*[id=""],a[href=""],a[href="#"]{outline:3px dotted #f00 !important;}
/* no width & height */
img:not([width]):not([height]){outline:5px dotted #00f !important;}
/* no alt */
img:not([alt]){outline:5px dotted #f00 !important;}
/* empty elements */
div:empty,span:empty,li:empty,p:empty,td:empty,th:empty{padding:1em;background-color:#ff0 !important;}
/* obsolete attributes */
html[version],
body[alink],body[link],body[text],body[vlink],body[background],body[bgcolor],
a[rev],a[charset],a[shape],a[coords],
img[longdesc],img[name],img[hspace],img[vspace],
object[archive],object[classid],object[codebase],object[codetype],object[declare],object[standby],
table[bgcolor],table[bgcolor],table[width],table[summary],table[cellpadding],table[cellspacing],table[rules],table[frame],
td[axis],td[abbr],th[axis],th[abbr],td[scope],td[height],th[height],td[width],th[width],tr[bgcolor],td[bgcolor],th[bgcolor],td[nowrap],th[nowrap],
caption[align],iframe[align],img[align],input[align],object[align],legend[align],table[align],hr[align],div[align],h1[align],h2[align],h3[align],h4[align],h5[align],h6[align],p[align],col[align],colgroup[align],tbody[align],td[align],tfoot[align],th[align],thead[align],tr[align],
col[valign],colgroup[valign],tbody[valign],td[valign],tfoot[valign],th[valign],thead[valign],tr[valign],
col[width],colgroup[width],pre[width],
col[char],colgroup[char],tbody[char],td[char],tfoot[char],th[char],thead[char],tr[char],
col[charoff],colgroup[charoff],tbody[charoff],td[charoff],tfoot[charoff],th[charoff],thead[charoff],tr[charoff],
dl[compact],menu[compact],ol[compact],ul[compact],
hr[noshade],hr[size],hr[size],hr[width],
iframe[marginheight],iframe[marginwidth],iframe[scrolling],iframe[frameborder],iframe[longdesc],
object[border],object[hspace],object[vspace],
ul[type],ol[type],li[type],area[nohref],
br[clear]{border:1px solid #0f0 !important;}
/* obsolete elements */
applet,basefont,center,dir,font,isindex,strike,xmp,big,tt,acronym{outline:10px solid #f00 !important;}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment