HTML and CSS Reference
In-Depth Information
/*
Copyright (c) 2006, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 0.11.0
*/
body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,
fieldset,input,p,blockquote,th,td{margin:0;padding:0;}
table{border-collapse:collapse;border-spacing:0;}
fieldset,img{border:0;}
address,caption,cite,code,dfn,em,strong,th,var
{font-style:normal;font-weight:normal;}
ol,ul {list-style:none;}
caption,th {text-align:left;}
h1,h2,h3,h4,h5,h6{font-size:100%;}
q:before,q:after{content:'';}
Other CSS authors have taken an even more dramatic approach, turning off absolutely
every possible default style the browser may have applied. For a more minimal approach to
resetting, you can get a lot of mileage out of simply zeroing out margins and padding on all
elements, like so:
* {
margin: 0;
padding: 0;
}
Whether you build your own mass reset file or use a publicly available one like Yahoo's or
Faruk's, you'll find that the mass reset will save you lots of headaches. Probably the simplest
way to incorporate a mass reset is to store the resetting rules in their own file and then use
@import to include that file in the style sheet you've linked to your (X)HTML document:
@import url("reset.css");
Summary
Management of CSS rules and files may seem like a mundane and tedious task—and it defi-
nitely can be. It is difficult to provide you with the “right” way to do this sort of thing, because
every project, designer, developer, and team is different. But taking the time to think about the
best way to handle these things for you or your organization and implementing a common
workflow (or even a reusable framework) will no doubt save you many headaches in the long
run.
Now that you're familiar with modern markup and how CSS works, and you've thought
through the management of your CSS files, it's time to move on to a topic that shouldn't really
be necessary but is: hacks and workarounds for CSS rendering bugs and inconsistencies in
web browsers.
Search WWH ::




Custom Search