I found and have been using two CSS scripts, one is for PRE tags, the other is more of an initializer, to set the base properties of all major elements. Let's not argue over the fact if CSS is a scripting language or not, but examine the two scripts:
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address,
big, cite, code, del, dfn, em, font, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, dl, dt, dd,
ol, ul, li, fieldset, form, label, legend, caption, table, tbody, tfoot, thead, tr, th, td {
margin: 0px; padding: 0px; border: 0px; outline:none; font-size: 100%;
}
It sets (if applicable) all of these element's properties to have no margin, padding or border, and sets the font size at 100% (you can add more if you want. This makes life much easier, especially if your about to sit down and write CSS for a fairly complex site.
- no borders on tables or iframe's - hopefully these are being used sparingly anyway.
- Sets a base of 100% on font size. No more guessing on pixels, just increase or decrease font size appropriately. e.g. font-size:85%
- No dotted outlines around images, especially ones enclosed inside of links.
- H1, ...H4 tags, no margins or padding and font-sizes - you set exactly what you want these attributes to be and in which containers. Important h1,h2 tags can be styled accordingly.
The next script is just for PRE tags, while it's not compliant with W3C, it does render well in almost every browser.
pre {
overflow-x: auto; /* Use horizontal scroller if needed; for Firefox 2, not needed in Firefox 3 */
white-space: pre-wrap; /* css-3 */
white-space: -moz-pre-wrap !important; /* Mozilla, since 1999 */
white-space: -pre-wrap; /* Opera 4-6 */
white-space: -o-pre-wrap; /* Opera 7 */
word-wrap: break-word; /* Internet Explorer 5.5+ */
}
Now, I will update this post if and when I can find where I first spotted these "scripts" and give proper credit to the author. If you happen to be the author, please leave a comment, along with your site so I can verify and give you some kuddo's.