The Initialization feature in Stylizer is loosely related to what is known as "CSS reset" in the industry. The feature is called "Initialization" instead of "CSS reset" because the two have a different goals. The goal of CSS reset is to totally eradicate all forms of default styling from the browser. Many designers question the practicality of this, as they are then required to go back and re-add much of what was removed. The goal of Initialization are to make the CSS development process more intuitive and predictable. The CSS generated by Initialization will be reviewed here.
To add Initialization to a style sheet, simply right-click on the style sheet and choose Add Initialization. Then, a new expandable row is added to the style sheet. Inside, there are 6 options. The first 4 options define the default text settings. The next two are more complicated.
Setting most of the elements on the page to position relative fixes a variety of problems in Internet Explorer 6 and 7 (hasLayout issues specifically). Below is the first rule generated.
* { margin: 0; padding: 0; font-size: 1em; position: relative; }
All margins and paddings are zeroed out, and the font size of 1em is set on all elements. This will cause the font size of all elements to default to the font size defined on the Body element. While positioning every element as relative has it's benefits, there are a few kinds of elements that shouldn't use relative positioning, as handled by the next generated rule:
HTML, BODY, THEAD, TBODY, TFOOT, TR, TH, TD { position: static; }
Note that the position: relative; declaration isn't generated when the Star Position Relative setting in Stylizer is off. The next rule contains the first 4 Initialization settings. These settings are applied to the page's Body element, which will then be inherited down through the entire page.
position: relative;
BODY { font-size: 11pt; font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif; line-height: 1.5; letter-spacing: -1px; }
Unfortunately not all elements on the page will inherit the settings above without additional CSS. For example, heading elements and the TH element render with a bold font by default. Simply setting these elements to font-weight: normal would break the inheritance model. Ideally, the element should acquire it's font weight from it's containing element. This is a trivial task in CSS, however, inheritance doesn't work as it should in Internet Explorer 6 and 7. Fortunately, Skybound has devised a work around. Examine the code below:
H1, H2, H3, H4, H5, H6, TH { font-weight: inherit; =font-weight: expression( this.__FW ? this.__FW : (new Function("t", "return (t.__FW=t.parentNode.currentStyle.fontWeight)"))(this) ); }
All headings and the TH element have been set to inherit their font weight from their containing element. Then, in Internet Explorer 6 and 7 only (via the equal hack), a Single Execution CSS Expression is used to collect the value from the parent element, cache it, and assign it to the font weight. Subsequent executions of the expression will return the cached value, for optimal performance.
The next rule does the same thing with the 4 elements that are browsers italicize by default:
ADDRESS, CITE, DFN, VAR { font-style: inherit; =font-style: expression( this.__FS ? this.__FS : (new Function("t", "return (t.__FS=t.parentNode.currentStyle.fontStyle)"))(this) ); }
Finally, the next rule does the same thing with the 10 rules that render with a different font by default:
CAPTION, CODE, KBD, PRE, SAMP, TT, INPUT, TEXTAREA, SELECT, BUTTON { font-family: inherit; =font-family: expression( this.__FF ? this.__FF : (new Function("t", "return (t.__FF=t.parentNode.currentStyle.fontFamily)"))(this) ); }
The next rule avoids an issue with older versions of Firefox, where hidden input fields are displayed rendered as a box on the screen.
INPUT[type=hidden] { display: none !important; }
Table heading elements center their content by default. The next rule causes these elements to inherit their content alignment setting from the containing element.
TH { text-align: inherit; }
Fieldset elements as well as images placed inside anchors are rendered with unattractive and undesirable borders by default. The next rule eliminates that problem:
FIELDSET, A IMG { border: 0; }
.container * { position: static; }