有的比较菜鸟的站长们,常常看到模板文件的CSS的代码密密麻麻的,就有点头晕!我在网上找到一位热心的站长给出了一份织梦模板的CSS详解,以下就是代码和代码的解释!
/*---------- import ---------*/ //调用外部CSS中调用外部CSS的语法是@import url("file.css");直接插入到CSS文件或之间就可以了,
@import url("layout.css");
@import url("page.css");
/*---------- base ---------*/ //基本样式
*{ //*,通用符
padding:0px; //对像间隔,
margin:0px; //左右边距
}
html{ //所有html均适用此样式
background:#FFF;
}
body{
font:12px Verdana,Arial,Tahoma; //正文字体,字号
}
img{
border:none; //图片,不显示边框
}
a{//超链接
color:#3366CC;
text-decoration:none; //表示没有下划线
}
a:hover{
color:#F33;
text-decoration:underline; //表示有下划线的
}
ul{
list-style.:none;
}
input,select,button{
font:12px Verdana,Arial,Tahoma;
vertical-align:middle; //坚直上居中排列
}
/*---------- stock ---------*/
.center{ //中间主体部分,导航栏处
margin:0px auto;
}
.w960{
width:960px; //中间主体宽度960
position:relative; //它可以随窗口大小变化
}
.mt1{/* ( margin-top * 1 ) */ //样式mt11,距顶端8PX
margin-top:8px;
}
.mt2{/* ( margin-top * 2 ) */
margin-top:16px;
}
.clear{
overflow:hidden; //让浏览器窗口永远不出现滚动条
}
.fs-12{
font-size:12px;
}
.fc-f60{
color:#F60;
}
.fc-f90{
color:#F90;
}
.ipt-txt{
line-height:15px;
padding:4px 5px;
border-width:1px;
border-style.:solid;
border-color:#666 #BBB #BBB #666;
font-size:12px;
margin-right:2px;
}
.btn-1{
width:56px;
height:23px;
border:none;
background:url(../images/btn-bg1.gif) no-repeat; //不平铺,repeat-x为向上平铺
line-height:25px; //行高为
letter-spacing:1px; //文字间隔属性
overflow:hidden;
color:#2F592E;
}
.btn-2{
width:70px;
height:25px;
border:none;
background:url(../images/btn-bg2.gif) left top no-repeat;
line-height:25px;
overflow:hidden;
color:#444;
margin-right:2px;
}
另一份:
.header{
width:100%;
padding-top:16px;
overflow:hidden;
}
.header a{
color:#777;
}
.header a:hover{
color:#390;
text-decoration:none;
}
.header .top{
clear:both;
overflow:hidden;
}
.header .title{
float:left;
padding-left:16px;
}
.header .title h1 a{
width:200px;
height:56px;
display:block;// 可以理解为块,DEDECMS的模板的css的详细解释》(https://www.unjs.com)。把这个区域变成块状。当然你加了宽度和高度效果不明显了。如果去掉宽度和高度试试。再去掉display试试就发现问题了font-size:0px;
text-indent:-200px;
overflow:hidden;
background:url(../images/top-logo.gif) center center no-repeat; //logo大小
}
.header .banner{
width:480px;
height:56px;
float:left;
margin-left:40px;
overflow:hidden;//顶部图片}
.header .banner img{
width:480px;