Quote:
Originally Posted by RbnJrg
It's not neccesary to employ "background-color"; just writting "background" will work because that it is a shorthand [...]
|
Hmmm, okay. I wasn't aware of that one.
I tend to avoid many of the shorthands, like
margin, and instead specify all 4 margins separately (if needed).
I believe it's more human-readable, instead of having to decipher EXACTLY what variables are what.
Examples from "margin" at MDN:
Code:
/* Apply to all four sides */
margin: 1em;
/* vertical | horizontal */
margin: 5% auto;
/* top | horizontal | bottom */
margin: 1em auto 2em;
/* top | right | bottom | left */
margin: 2px 1em 0 auto;
vs. something like:
Code:
blockquote {
margin-top: 1em;
margin-bottom: 2em;
}
Whenever I run across the shorthand, especially that 3rd or 4th one, I'm always scratching my head trying to remember which number stands for which variable.
When you have it fully typed out, there's no confusion there.