|
各模块所使用不同图片效果的方法
|
|
|
|
Author: Autoit | Date:2006-06-15 | View: 13977 | Digg: 69 |
|
常见使用的方法是: - 在模板里直接加,方法是先把你站点的结构草图出来, 然后固定地方,直接做在了模板的index.php里, 及格做模板的朋友都这样做, 当然缺点是不够灵活. 比如要把这个模块换下位置,就要在动index.php了,试问,谁建好的站频繁的改动呢? 其实这个方法的在操作上直接直观,表现手法灵活.
- 在css里定义, 对不熟悉Css的朋友来说就有点难度了.下面是一组Css样式的例子,相信你照猫画虎的也能做了出来!
div.module_menu{
width:167px;
padding-top:32px;
background:url("../images/menu.gif") top no-repeat;
}
div.module_latestnews{
width:167px;
padding-top:32px;
background:url("../images/latestnews.gif") top no-repeat;
}
div.module_hot{
width:167px;
padding-top:32px;
background:url("../images/hotnews.gif") top no-repeat;
}
div.module_quality {
width:167px;
padding-top:32px;
background:url("../images/quality.gif") top no-repeat;
}
div.module_research {
width:167px;
padding-top:32px;
background:url("../images/recerche.gif") top no-repeat;
}
table.module_faq th {
background: url(../images/faq.png) no-repeat;
color: #ffffff;
padding-top: 46px;
padding-left:18px;
height: 44px;
}  看到后,你应该知道怎么做了吧. 如果你的模块是默认样式输出,即表格输出的话,只需要定义 table.module th 即可, 当然如果各个不同需定义此模块的后缀样式就可以了,比如上面的table.module_faq th, 其他div也都是如此.
当然还有一些人用的Js动态替换,这里就不多说了. Permanent URL: http://www.autoit.cn/index.php/content/view/39/25.html
|