CSS. . , .
CSS . :
.top
.top,
.top, , #news
... ..
, , . .top, , - #news, #news.top.
.
margin:0 5px;
margin:0 5px 0 5px;
This is basic, but you would be amazed at how many people do not.
Also find out what you can short-circuit:
ex: font:bold 12px Helvetica, Arial, sans-serif;
One thing that is very useful is that you alphabetically order your rules. Especially if you use CSS3 -webkit- and -moz- properties. I get a lot of response to this, but I work with 12+ developers, and I saw
.myClass { color:#f00; color:#fff; }
If they are in alphabetical order, you will avoid code duplication.
source
share