4 ms·
Interesting. I never knew I was doing CSS Reset all this time. I add this to the top of most of my CSS files: body, html, form { margin:0; padd
by chime 16y ago
Interesting. I never knew I was doing CSS Reset all this time. I add this to the top of most of my CSS files:
body, html, form {
margin:0;
padding:0;
}
table {
border-collapse:collapse;
}
a {
text-decoration:none;
}
There are a few more rules I add but they depend on each site of course.
- baby 16y agoI don't use border-collapse (I don't even know what it is) but i have those also : body{ font-family:verdana; font-size:0.8em; } p,h1,h2,h3,h4{ margin:0; padding:0; font-weight:normal; } ul{ list-style:none; margin:0; }
- sirn 16y ago> I don't use border-collapse (I don't even know what it is) When two borders are stacked together, they will be collapsed into a single border. Only works with tables though.
- mikeryan 16y agoThe ul rules are the only ones I thought were missing from this. Its probably not semantically correct but I use those much more for layout then actual lists these days.
- rimantas 16y agoI just add whatever rules I need for my elements. I don't get this all fuss about CSS Resets, and to have them in separate file is not… very wise, let's say.
- armandososa 16y agoI think they call it code reuse or Don't Repeat Yourself or something unwise like that. Dumbzucks!
- rimantas 16y agoI call it needless overhead. Seriously, is it that difficult to reset padding and margins only when you need that? Do you really want to have extra HTTP request for some dumb CSS file you can do just fine without? And it has nothing to do with code reuse. Setting a margin, whoa, rocket surgery, no less.
- DCoder 16y agoThe whole point of a Reset is to have a clean slate to start from. Do you really know, and want to know, every case where IE6/Safari3/ObscureBrowser300 adds a default padding/margin, and how that is different from Opera/Firefox/etc? Same for font families, sizes and styles? In my opinion, working without a reset of some kind is quite similar to writing C++ classes where data members are not initialized to meaningful values... you just can't trust what you'll end up with.
- rimantas 16y agoDo you really know, and want to know, every case where IE6/Safari3/ObscureBrowser300 adds a default padding/margin, and how that is different from Opera/Firefox/etc? If I care about the margin, I will set it myself anyway. If I don't care, I don't care what the default is and have no need to reset it. As simple as that.
- DCoder 16y agoYour choice. I'll just take YUI Reset, combine it with YUI Base, both of which have already been tested thoroughly, and get a reusable foundation for future use.