This question is geared towards CSS3, I’ve been looking at a few boilerplate templates and guides and most of them declare a whole lot of attributes before even going into what you want to edit.
-
Why is this so? Does declaring all of the usable attributes make the
browser load faster or something? -
What are the benefits? Why not just use CSS3 “as is” (like just declaring what’s being used in the HTML section)?
-
And if the underlying attribute changes in further editions, wouldn’t
it mean you would have to constantly keep a check on deprecated
attributes and keep declaring and changing attributes every once in a while?
HTML5Boilerplate contains a version of normalize.css. Rather than just reset everything to 0 (i.e. margins, padding etc) it has the minimum set of changes to ensure things have the same settings in all browsers. In their own words:
An example of a style used here is:
This fixes some weirdness in older IE, as well as on iOS. This is the sort of thing that you’ll likely have a problem with, read loads, find a solution and add in eventually yourself. By using this set of defaults you can avoid a lot of weirdness.
As well as bugs, it includes things you’d likely want anyway:
Using a ul in a nav is a common pattern, and you usually don’t want bullet points there. This sorts that for you.
In all, I’d recommend using your own custom version of their code – it will save you a lot of annoyance!