CSS Diagnostic script

Posted by – June 5, 2008

I found the following piece of code here. I pasted the stuff in one of my recently done layout and found that

  • don’t leave alt blank, put some thing there
  • height and width must be controlled using CSS only, I knew this is in context of tables and divs but wasn’t aware of the fact that this rule applies to images too, d’oh! silly me


/* 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=""], *[], *[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; }

3 Comments on CSS Diagnostic script

  1. site slicing says:

    Good points, but make it more generally

  2. Rohit Rawat says:

    :-) Making a point out here.

    Another Good one. It just refreshed. Thanks for the same.

  3. [...] height and width must be controlled using CSS only, I knew this is in context of tables and divshttp://www.shameless-self-promotion.org/2008/06/05/css-diagnostic-script/New engines boost Bravo appeal UK The Auto ChannelThree new additions to Fiat’s 5-door mid-size [...]

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>