如何在同一个网页设置两种超链接样式

http://zhidao.baidu.com/question/286649802.html
你说的 设置div1 a 和div2 a 我知道这个在CSS里面设置好了 但是 怎么把这个应用的 某个超链接上啊 比如说
<td width="90"><div align="center"><a href="index.html" target="_blank">系部首页</a></div></td>
我这个单元格的超链接需要应用div1 a 的样式 怎么改
如果是.{}那么<td class="div1a">
我的
div1 a:link {
font-family: "宋体";
font-size: 14px;
color: #000000;
text-decoration: none;
border-top-width: 1px;
border-right-width: 1px;
border-bottom-width: 1px;
border-left-width: 1px;
border-top-style: none;
border-right-style: none;
border-bottom-style: none;
border-left-style: none;
}
div1 a:hover {
background-image: url(../imges/d1_01.jpg);
font-size: 15px;
color: #00FF00;
text-decoration: none;
}
div1 a {
display:block;
width:100%;
height:100%;
line-height: 35px;
color: #000000;
text-decoration: none;
font-size: 14px;
}
我这样的 然后 在有链接的那个 单元格 td里面 用.{}那么<td class="div1a">
当我输入class= 的时候 后面没有 div1 a 这个类 所以 就算输入进去了 也 没作用 应用不了 这个 样式

  使用css样式即可,方法如下:

  1、在网页头部<head></head>直接放置以下代码:
<style type="text/css">
a.topcs:link {
font-size: 12px;
color: #000000;
text-decoration: none;
}
a.topcs:visited {
font-size: 12px;
color: #000000;
text-decoration: none;
}
a.topcs:hover {
font-size: 12px;
color: #FF0000;
text-decoration: none;
}
a.news:link {
font-size: 12px;
color: #000000;
text-decoration: none;
}
a.news:visited {
font-size: 12px;
color: #000000;
text-decoration: none;
}
a.news:hover {
font-size: 12px;
color: #FF0000;
text-decoration: none;
}</style>

  2、在网页主体建立超链接,分别套用topcs和news样式:
  <a href="1.html" class="news">1</a><a href="2.html" class="topcs">1</a>
温馨提示:答案为网友推荐,仅供参考
第1个回答  推荐于2017-11-25
应该这么写:
<td width="90"><div class=“div1” align="center"><a href="index.html" target="_blank">系部首页</a></div></td>
然后在网页里写
<style>
.div1 a{这里写你的css样式
}
</style>
注意:写css样式前如果是class必须加“.”
如果css样式不在网页里写比如在(table.css)这个文件里写样式
那你需要在网页的<head></head>下面加链接
<link type="text/css" href="styles/table.css" rel="stylesheet">
知道怎么改吗?

不知道我说的是不是你要的 有需要的可以帮你忙。本回答被提问者采纳
第2个回答  2012-06-13
这个还要看你的css用的方式
是 #{} 还是 .{}
如果是.{}那么<td class="div1a">
如果#{}那么<td id="div1a">追问

这两种方式有什么具体区别 具体怎么设置的