Johannes Koch wrote:
liketofindoutwhy schrieb:
>HTMLDog seems quite good. i didn't understand why it suggested using
border: 0... i thought it would be better if it is border: none.
'border: 0' sets another property (border-width) than 'border: none'
(border-type). Both are covered by the 'border' shorthand.
Actually, they set exactly the same _properties_, though to different
_values_.
border: 0 by definition sets
border-width to 0
border-style to none
border-color to content color of the element
border: none by definition sets
border-width to medium
border-style to none
border-color to content color of the element
Thus, they are _not_ equivalent, even though they _often_ have the same
effect. Of course, they both imply just that no border appears _if_ no other
style sheet is applied. However, if no other style sheet is applied,
border-style is none anyway, as that's the initial value as defined in CSS
specifications!
If you later set, for example, border-style: solid for the element, then no
border appears if you had first set border: 0 (since border width is still
zero). But if you had first set border: none, then you will see a solid
border of width medium (typically 4 pixels) with the element's content
color.
Rules for using "shorthand notations" (like border and font) in CSS:
1. If you don't really understand them, don't use them.
2. If you really understand them, you don't need my advice to stay away from
them. :-)
--
Yucca,
http://www.cs.tut.fi/~jkorpela/