Links
I have seen a LOT of people purporting that they know how to create websites with CSS. But, when I see style rules such as:
img
{border:none;}
I cringe. The criteria for any style rule whether it be an element, class or id: If it has a NUMBER associated with it such as; 1px the value associated with that, if you want that value to be NOTHING is “0″, not “none”.
So, basically this is how that would work:
Normally a link has an underline. In CSS that rule is text-decoration:
What kind of a value is a text-decoration? Does it have a numerical size, or a text rule definition with a number?
The text-decoration choices are:
none, underline, overline - Do you see a NUMBER among the choices? NO! so if you do NOT want any decoration of the a, or a:visited such as an underline the choice would be:
text-decoration:none;
Now, if you do NOT want a border on an element such as an image, the rule would be as follows:
img {border:0;}
Now, why “0″ instead of “none”? Borders have a numerical “size” value such as 1px, 5px, etc. So, if you do NOT want any border you must designate that border value as “0″ because borders, margins, and padding have “NUMERICAL values”, instead of “text values” as to size rather than appearance.
Another CSS Tip
Claire Poulton
No Comments »
Leave a Reply
You must be logged in to post a comment.























