
{
text-align:left;
background: #fff
}
#container
{
margin:0 auto;
width:960px;
background:#fff;
}
#header
{
margin:0 auto;
border-top:#900 0px;
}
#content
{
width:960px;
float:left;
padding-left:0px;
padding-right:1px;
margin-top:0px;
background:#fff;
}
#navigation
{
margin:0 auto;
width:960px;
float:left;
margin-top:1px;
padding-left:8px;
padding-right:0px;
margin-bottom:1px
}
#sidebar
{
width:180px;
float:left;
padding-left:15px;
padding-right:1px;
margin-top:0px;
}
#footer .gutter
{
background:#ffffff;
padding:0px;
margin: 0 auto;
width:960px;
}
最好能增加鼠标点过变色
a{ color:#333; text-decoration:none; }
a:hover{ color:#F33; text-decoration:underline; }
a:visited{ color:#333; text-decoration:none; }
第一行的代码是超链接未有鼠标经过或点击的状态color是字体颜色text-decoration:none;表示没有下划线
第派亩二行的代码是有鼠标经过时的状态同样color是字体颜色而text-decoration:underline;是有下划线
第三行是被鼠标点过的链接也就是被访销亏问过的链接的状态其他同上
如果把这三行代码直接放到样式表里,是对全局进行控制。
如果你想对单独某个标签里进行相关设置,可以在样式后面加上上面的代码比如:
#sidebar a{ color:#333; text-decoration:none; }
#sidebar a:hover{ color:#F33; text-decoration:underline; }
#sidebar a:visited{ color:#333; text-decoration:none; }
这样sidebar层里面的链接,都会尘斗森按照上面的设置产生效果。
CSS中用四个伪类来定义链接的样式,分别是:a:link、a:visited、a:hover和a : active,例如:
a:link{font-weight : bold ;text-decoration : none ;color : #c00 ;}
a:visited {font-weight : bold ;text-decoration : none ;color : #c30 ;}
a:hover {font-weight : bold ;text-decoration : underline ;color : #f60 ;}
a:active {font-weight : bold ;text-decoration : none ;color : #F90 ;}
以上语句分别定义了"链接、亏乎喊已访问过的链接、鼠标停在上方时、点下鼠标时"的样式。注意,必须按以上顺序写,否则显示可能和你预想销野的不一样。记顷滑住它们的顺序是“LVHA”。