HTML and CSS Reference
In-Depth Information
White space is your friend. You can remove it before you go live if you like,
but the gains in cleanliness and readability are worth the few extra bytes
(which you could always cut back down on by Gzip'ing your files anyway).
Make the code readable and maintainable first and foremost, then worry
about file size later. Happy developers are worth more than a few kilobytes
in saved weight.
Code Should Take Care Of Itself
So far, we've talked about people maintaining your code, but what about
actually using it?
You can do a number of things to make the life of whoever inherits your
code much easier — and to make you look like a saint. I can't think of many
generic examples, but I have a few specific ones, mainly from inuit.css.
INTERNATIONALIZE YOUR SELECTORS
Inuit.css has a class named .centered , which is spelt in US English. CSS is
written in US English anyway, so we're used to this; but as an English
developer, I always end up typing UK English at least once in a project. Here
is the way I have accounted for this:
.centred, .centered {
[style]
}
Search WWH ::




Custom Search