CSS Equalizer
November 4 2005 November 4, 2005CSS Equalizer is basically just my attempt to create a stylesheet that "equalizes" the browser experience for web developers. I try to do this by re-defining all of the tag rules before any custom styles are applied. Theoretically if all styles start out equal they should end up equal. A pre-load of those rules should accomplish this ... and to a large extent it seems to be working.
Just try loading this CSS before your own styles and test it on different web browsers to see it in action. Oh and, of course, this website uses CSS Equalizer.
equalizer.css- /**
- * equalizer.css
- *
- * An equalizing stylsheet designed for the sole purpose of resetting the
- * rendering behaviors of all modern web browsers before applying any custom
- * CSS styles. This stylesheet must be loaded before all others.
- *
- * @author Toby Miller <tmiller@tobymiller.com>
- * @copyright Copyright (C) 2008, Toby Miller
- * @license http://www.opensource.org/licenses/mit-license.php The MIT License
- * @version 0.2
- */
-
- HTML, LEGEND {
- color:#000;
- background:#FFF;
- }
- BODY {
- font:13px/1.231em Verdana,Helvetica,Arial,sans-serif;
- }
- BODY, DIV, DL, DT, DD, UL, OL, LI, H1, H2, H3, H4, H5, H6, PRE, CODE, FORM,
- FIELDSET, LEGEND, INPUT, TEXTAREA, P, BLOCKQUOTE, TH, TD {
- margin:0;
- padding:0;
- }
- BLOCKQUOTE, UL, OL, DL {
- margin:1em;
- }
- OL, UL, DL {
- margin-left:2em;
- }
- DL DD {
- margin-left:1em;
- }
- OL LI {
- list-style: decimal outside;
- }
- UL LI {
- list-style: disc outside;
- }
- TABLE {
- border-collapse:collapse;
- border-spacing:0;
- font-size:inherit;
- font-size:100%;
- }
- IMG {
- border:0;
- }
- ADDRESS, CAPTION, CITE, CODE, DFN, EM, STRONG, TH, VAR {
- font-style:normal;
- font-weight:normal;
- }
- EM {
- font-style:italic;
- }
- H1,H2,H3,H4,H5,H6,STRONG {
- font-weight:bold;
- }
- PRE, CODE, KBD, SAMP, TT {
- font-family:"Courier New",Courier,monospace;
- line-height:100%;
- }
- LI {
- list-style:none;
- }
- CAPTION, TH {
- text-align:center;
- }
- CAPTION {
- margin-bottom:.5em;
- }
- TH {
- font-weight:bold;
- }
- TH, TD {
- border:1px solid #000;
- padding:.5em;
- }
- H1, H2, H3, H4, H5, H6 {
- font-size:100%;
- }
- H1 {
- font-size:138.5%;
- }
- H2 {
- font-size:123.1%;
- }
- H3 {
- font-size:108%;
- }
- H1,H2,H3 {
- margin:1em 0;
- }
- P, FIELDSET, TABLE, PRE {
- margin-bottom:1em;
- }
- Q:before, Q:after {
- content:'';
- }
- ABBR, ACRONYM {
- border:0;
- border-bottom:1px dotted #000;
- font-variant:normal;
- cursor:help;
- }
- SUP {
- vertical-align:text-top;
- }
- SUB {
- vertical-align:text-bottom;
- }
- INPUT, TEXTAREA, SELECT {
- font-family:inherit;
- font-size:inherit;
- font-weight:inherit;
- }
- TEXTAREA {
- overflow:auto;
- overflow-y:scroll;
- }
-
-
And for those of you that still have to support IE, pity. Load this in as well.
equalizer-ie.css- /**
- * equalizer-ie.css
- *
- * An companion equalizing stylsheet to equalizer.css designed for the sole
- * purpose of resetting the rendering behaviors of IE browsers which without
- * the employ of any CSS hacks. This stylesheet must be loaded after
- * equalizer.css but before all others.
- *
- * To load this stylesheet for IE browsers only please use the following
- * syntax:
- *
- * <!--[if lt IE 8]>
- * <link rel="stylesheet" type="text/css" media="all" href="css/equalizer-ie.css"/>
- * <![endif]-->
- *
- * @author Toby Miller <tmiller@tobymiller.com>
- * @copyright Copyright (C) 2008, Toby Miller
- * @license http://www.opensource.org/licenses/mit-license.php The MIT License
- * @version 0.2
- */
-
- BODY {
- font-size:small;
- font:x-small;
- }
- PRE, CODE, KBD, SAMP, TT {
- font-size:108%;
- }
- INPUT, TEXTAREA, SELECT {
- font-size:100%;
- }
-
-
I like input so please pass it on if you have some. =)