css优化篇
平时总说如何如何优化,今天就详细的写一下css如何优化,嘿嘿。 首先,CSS的优化工作主要从两个方面着手
合写CSS :能合写的属性不要分开写,部分例子如下background属性1 .test{2 background: #000 url(image.jpg) left top no-repeat;3 } 4 background-image: url(image.jpg);5 background-position: left top;6 background-repeat: no-repeat; margin/padding{margin-top: 5px; margin-right: 10px; margin-bottom: 5px; margin-left: 10px;}{margin: 5px 10px 5px 10px;} 顺时针{border-top: 2px; border-right: 5px; border-left: 10px; border-bottom: 3px;}{border: 2px 5px 10px 3px;} font{font: oblique bold 16px/35px Helvetica,Arial} font-style: oblique; font-weight:bold; font-size: 16px; line-height:35px; font-family:Helvetical,Arial;
|
- 上一篇:IE兼容问题,各类css hack代码(亲测有效)
- 下一篇:css HACK