CSS diagnostics Script


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

Find deprecated elements and attributes using CSS. Simply add the CSS below to the end of your style sheet and it will highlight bad code.


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

URL: http://reinholdweber.com/?p=23

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.