下面我先引用下
百度默认的 CSS 样式2009-10-02 18:23html,body,div,h2,h3,h4,p,td,tr,ul,ol,li,table,dl,dd,dt,img,form{margin:0;padding:0;}
ol,ul,li {list-style:none}
body {font-size:14px;line-height:24px;font-family:arial}
这一段CSS是百度的。
由上面我们可以看到,百度会把一些公用的都先定义了,而我在 bbs.web520.com 看到有一个网友的网站说给百度给封杀了。
首先我对其进行了几点分析:
1、发了不该发的连接。
2、反连有问题。
3、密度过高。…………
等做了一些分析,其中包含了CSS
下面是其中一段
bo_4{width:440px; height:22px; margin:172px 0 0 0!important; margin:10px 0 0 0; padding:0; border:0; float:left;}
.bo_5{width:440px; height:90px; margin:10px 0 0 0;; padding:0; border:0; float:left;}
.bo_5_1{width:120px; height:90px; margin:0; padding:0; border:0; float:left; background:url(../img/14.jpg) no-repeat center left; list-style:none;}
.bo_5_2{width:315px; height:90px; margin:0; padding:5px 0 0 5px; border:0; float:left; font-size:12px; text-align:left; line-height:20px; list-style:none;}
.bo_5_3{width:120px; height:90px; margin:0; padding:0; border:0; float:left; background:url(../img/15.jpg) no-repeat center left; list-style:none;}
.bo_5_4{width:120px; height:90px; margin:0; padding:0; border:0; float:left; background:url(../img/16.jpg) no-repeat center left; list-style:none;}
.bo_5_5{width:120px; height:90px; margin:0; padding:0; border:0; float:left; background:url(../img/17.jpg) no-repeat center left; list-style:none;}
.bo_5_6{width:120px; height:90px; margin:0; padding:0; border:0; float:left; background:url(../img/18.jpg) no-repeat center left; list-style:none;}
在这里我们可以看到出现了好多 0 啊 这是有种非常不好的写法。
回到主题:
作为在制作 CSS模板时,很多朋友可能会说,那么如何去制作一个好的CSS模板呢?下面是我的个人见解:
1、CSS中尽量不要出现 负值。
2、隐藏一类的也最好不要出现。 hidden
3、书写ID CLASS也要注重一下顺序。 不要把 header 放在后面 footer 放在前面。
4、网页无素标记当然也不要乱用了。 如,像现在有的朋友喜欢写 双 TITLE 等一些大量的 重复 H 标记。
5、还是强调 CSS 中能够共用的尽量独立下属性,以便 多次引用。
注:未必制作出了一个好的CSS模板就一定能够取得好的排名;请朋友更要看重的网站本身的内容质量,我一值信觉得,内容占7分,反连占3分。
http://16378.cn/ 这里有我处理 LOGO这个地方的一点小技巧。为了不浪费域名,所以 搞了点内容,也练习CSS.
<div id="logo"><a href="/" title="中国商机网"><h1>中国商机网</h1></a></div>
CSS:吗你可以自己看下。
