关于页面CSS调用时遇到的问题

来源:百度知道 编辑:UC知道 时间:2024/09/20 17:43:47
由于网页内某一部分需要,我在网页头部加入了以下A标签CSS样式
************************************************
a {
font-family: "宋体";
font-size: 12px;
font-weight: bold;
color: #006699;
text-decoration: none;
line-height: 12px;
width: 100px;
display: block;
vertical-align: middle;
}
a:hover {
font-family: "宋体";
line-height: 12px;
font-size: 12px;
font-weight: bold;
color: #FF9900;
text-decoration: none;
}
***************************************
而该页面其他的文字连接全部也变的和这一部分一样,也引用到了
display: block;
文字外边都套了一个区块(?)搞的页面很难看,希望CSS高手帮忙解决一下

当然了,你这样写是给<a></a>赋予样式
也就是说所有的链接会是这种样式
可以把
a {
font-family: "宋体";
font-size: 12px;
font-weight: bold;
color: #006699;
text-decoration: none;
line-height: 12px;
width: 100px;
display: block;
vertical-align: middle;
}
换个名字,如
.aa{
font-family: "宋体";
font-size: 12px;
font-weight: bold;
color: #006699;
text-decoration: none;
line-height: 12px;
width: 100px;
display: block;
vertical-align: middle;
}
.aa a:hover {
font-family: "宋体";
line-height: 12px;
font-size: 12px;
font-weight: bold;
color: #FF9900;
text-decoration: none;
}