1 例如 目录结构
-- index.html
-- css/main.css
-- images/1.jpg ; 2.jpg; 3.jpg
index.html引用main.css
在main.css 引用images目录里的1.jpg
background: #6293bb url(../images/shadow.png) *** 正确
background: #6293bb url(images/shadow.png) *** 错误
总结,写css里的图片路径,url是图片针对目前main.css的位置
2
两个相同的class之间用 逗号 阁开
例如: td.read_forum, td.topic_icon{ 注意2个class之间用逗号*/
background-color:#EFEFEF;
}
3 写class中间用空格号
例如: <table id="forum_main">
<thead>
<tr>
<td colspan="2" class="first_col" style="width: 620px;">论坛</td>
<td style="width: 60px;">主题</td>
</tr>
</thead>
<tbody>
</table>
说明:
table#forum_main thead td { //中间用空格
background-image: url(../images/bg_cel2.gif);
color: #ffa34f;
border-top: 1px solid white;
}
4 哪里的class,是用点号
table#forum_main thead td.first{ //td后面用点号
border-left: 1px solid white;
}
-- index.html
-- css/main.css
-- images/1.jpg ; 2.jpg; 3.jpg
index.html引用main.css
在main.css 引用images目录里的1.jpg
background: #6293bb url(../images/shadow.png) *** 正确
background: #6293bb url(images/shadow.png) *** 错误
总结,写css里的图片路径,url是图片针对目前main.css的位置
2
两个相同的class之间用 逗号 阁开
例如: td.read_forum, td.topic_icon{ 注意2个class之间用逗号*/
background-color:#EFEFEF;
}
3 写class中间用空格号
例如: <table id="forum_main">
<thead>
<tr>
<td colspan="2" class="first_col" style="width: 620px;">论坛</td>
<td style="width: 60px;">主题</td>
</tr>
</thead>
<tbody>
</table>
说明:
table#forum_main thead td { //中间用空格
background-image: url(../images/bg_cel2.gif);
color: #ffa34f;
border-top: 1px solid white;
}
4 哪里的class,是用点号
table#forum_main thead td.first{ //td后面用点号
border-left: 1px solid white;
}