CSS Diagnostics


/ Published in: CSS
Save to your folder(s)

CSS snippet for diagnostics to find empty elements etc.


Copy this code and paste it in your HTML
  1. /* Empty Elements */
  2. div:empty, span:empty, li:empty, p:empty, td:empty, th:empty
  3. { padding: 20px; border: 5px dotted yellow !important; }
  4.  
  5. /* Empty Attributes */
  6. *[alt=""], *[title=""], *[class=""], *[id=""], a[href=""], a[href="#"]
  7. { border: 5px solid yellow !important; }
  8.  
  9. /* Deprecated Elements */
  10. applet, basefont, center, dir, font, isindex, menu, s, strike, u
  11. { border: 5px dotted red !important; }
  12.  
  13. /* Deprecated Attributes */
  14. *[background], *[bgcolor], *[clear], *[color], *[compact], *[noshade], *[nowrap], *[size], *[start],
  15. *[bottommargin], *[leftmargin], *[rightmargin], *[topmargin], *[marginheight], *[marginwidth], *[alink], *[link], *[text], *[vlink],
  16. *[align], *[valign],
  17. *[hspace], *[vspace],
  18. *[height], *[width],
  19. ul[type], ol[type], li[type]
  20. { border: 5px solid red !important; }
  21.  
  22. /* Proposed Deprecated Elements */
  23. input[type="button"], big, tt
  24. { border: 5px dotted #33FF00 !important; }
  25.  
  26. /* Proposed Deprecated Attributes */
  27. *[border], a[target], table[cellpadding], table[cellspacing], *[name]
  28. { border: 5px solid #33FF00 !important; }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.