5 ms·
Whoah. CSS Reset Styles make perfect sense, and I can totally see why people use them... And yet, I'd never thought of that, and certainly never seen the nice
by angelbob 17y ago
Whoah. CSS Reset Styles make perfect sense, and I can totally see why people use them... And yet, I'd never thought of that, and certainly never seen the nice comprehensive one he posted (no, not the one-liner :-)
Apparently I need to start doing that. Like, yesterday.
- robin_reala 17y agoThey don’t really. If you’re browser checking your build then you should uncover any inconsistencies that your actual stylesheet hasn’t covered. Once you’ve fixed those then you have no need for the reset stylesheet in the first place.
- euroclydon 17y agoI guess you're correct, but it just feels better to me knowing I'm working from a clean slate, then accepting whatever padding, line spacing, font size, and margins that browser though would look nice. I found that my CSS skills really improved when I added a style reset and was forced to contemplate all the styles which were previously given to me without consideration by the browser.
- robin_reala 17y agoThat’s a fair point, they are useful as a learning aid. It’s just important to bear in mind that not only are reset stylesheets not required in the long run but they’re actively inefficient.
- ubernostrum 17y agoA reset is a form of future-proofing. If a new browser, or new browser version, appears with its own ideas about default values for margin, padding, etc., then so long as its CSS support is decent your existing reset will make it either mostly or completely work from day one. This does not mean "never do browser testing" -- you should (and you should do it smartly, based on what's known about both the browsers and your demographics) -- but it does mean that you're less likely to get caught with your pants down. Also, for my money, the best regime out there for classifying browsers and organizing a testing system is Yahoo's graded browser support. And oddly enough, they seem to like resets...
- robin_reala 17y agoA good point. Still, it always comes down to a cost/benefit equation. Balancing the cost of a sending every user a set of reset styles in terms of extra page weight against the benefit of some possible future-proofing against some possible browsers then my choice would be to go with the lighter site.
- ubernostrum 17y agoIf your CSS is minified and compressed, a reset is almost unnoticeably small. The YUI 3 reset stylesheet, for example, is 858 bytes uncompressed.
- adamhowell 17y agoDifferent browsers have different defaults for things like checkbox padding & margin, line-height, etc. A reset stylesheeet gets rid of those. I don't start a site w/o one.
- robin_reala 17y agoYes, they do, but you don’t need to reset them first then set them again. You can just set them to your own choice and be done with it.
- angelbob 17y agoHm. I'm dubious about "testing will find all the problems" as a solution here. Isn't that a little like saying "you need to check JavaScript in all browsers anyway, so why use a compatibility library?"
- robin_reala 17y agoThe compatibility issues between JS implementations in browsers are much worse than between CSS implementations. Besides, most JS libraries add additional functionality. There is one library that just tries to normalise a base set of JS across browsers (Dean Edward’s Base2) but no-one uses it.
- abossy 17y agoQuickly loading up Google Analytics shows me that visitors to my site have used 9 browsers (excluding version #), 6 OSes, and 41 screen resolutions in the past month. The time it takes to cover that matrix of viewing combinations simply isn't worth the investment and hence a reset sheet should save you a lot of time.
- robin_reala 17y agoSo you’re saying you don’t support all these browsers? A reset stylesheet isn’t a magical fix for every issue - you still need to check in the browsers your users have chosen. That’s part of the pain of being a front end developer: you’re not just coding for one consumer.
- Semiapies 17y agoI wouldn't worry about it for existing sites, but it's a good start for the CSS in a new site. EDIT: or full overhaul of an existing site.