永发信息网

div+css如何设置文本链接样式

答案:3  悬赏:70  手机版
解决时间 2021-04-28 00:05
  • 提问者网友:放下
  • 2021-04-27 08:40
新手求教一下......div+css如何设置文本链接样式,即文本正常状态,访问后状态,鼠标经过状态的样式,最好是代码结合css的设置方法......
最佳答案
  • 五星知识达人网友:纵马山川剑自提
  • 2021-04-27 10:05

a 为统一超级链接,
a:link没有点击过的超级链接样式
a:visited 被点击过的超级链接样式
a:hover 鼠标指向时的超级链接样式
a:active 被用户激活(在鼠标点击与释放之间发生的事件)时的样式.少用 下面代码给你参考下
*******************************************/


a {
font-size: 12px;
}
a:link {
color: #333333;
text-decoration: none;
}
a:visited {
text-decoration: none;
color: #333333;
}
a:hover {
text-decoration: underline;
color: #4E667B;
}
a:active {
text-decoration: none;
}

全部回答
  • 1楼网友:神鬼未生
  • 2021-04-27 11:48

这有15种的代码设计。。。。其实不过就是

a{},和a:hover{},a:active{},a:linked{}之类的设计罢了。。。

<html> <head> <title>领地吧 CSS打造多彩文字链接</title> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <style type="text/css"> td { font-size : 12px; font-family : 宋体; } a { font-family: "宋体"; font-size: 9pt; text-decoration: none} .t1{ color: #CC0000;text-decoration: underline } .t2{ text-decoration : none; color:#006699; }

.t3 { color: #006600; text-decoration: underline overline} .t4 { color: #0066FF; text-decoration: line-through} .t5 { border: 1px #FF0000 solid; height: 20px; color: #000099} .t6 { border: #FF0000 solid; height: 0px; color: #0066FF; border-width: 0px 0px 1px} .t7 { border: #FF0000 solid; height: 0px; color: #0066FF; border-width: 0px 0px 1px; padding-bottom: 5px} .t8 { border: #FF0000 solid; height: 0px; color: #0066FF; border-width: 0px 0px 1px; width: 200px; text-align: center} .t9 { border: #FF0000 double; height: 0px; color: #0066FF; border-width: 0px 0px 3px} .t10 { border: 1px #FFFF00 solid; color: #FFFF00; clip: height; background-color: #990000; height: 20px; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; width: 130px: 0px} .t11 { PADDING-RIGHT: 2px; PADDING-LEFT: 2px; PADDING-BOTTOM: 2px; PADDING-TOP: 2px; background-color:#D9DEE8; height: 25px; width: 150px; text-align: center; ; border: #D9DEE8; border-style: outset; border-top-width: 2px; border-right-width: 2px; border-bottom-width: 2px; border-left-width: 2px} .t12{ text-decoration : none; color:#006699; ; height: 25px; width: 130px; padding-top: 4px; padding-right: 4px; padding-bottom: 4px; padding-left: 4px ; border: 1px #0000CC solid ; filter: Blur(Add=1, Direction=45, Strength=2) ; text-align: center } .t13 { color: #FFFF00; text-decoration: none; height: 25px; width: 120px; font-family: "宋体"; font-size: 12px; background-image: url( http://www.qpsh.com/icon/bk3.gif); padding-top: 6px; padding-left: 5px; text-align: center} .t13:hover { color: #FFFFFF; text-decoration: none; background-image: url( http://www.qpsh.com/icon/bk4.gif); height: 25px; width: 120px; padding-top: 6px; padding-left: 5px; text-align: center} .t14 { color: #FFFF00; text-decoration: none; height: 25px; width: 120px; font-family: "宋体"; font-size: 12px; background-image: url( http://www.qpsh.com/icon/bk1.gif); padding-top: 5px; padding-left: 5px} .t14:hover { color: #000000; text-decoration: none; background-image: url( http://www.qpsh.com/icon/bk2.gif); height: 25px; width: 120px; padding-top: 5px; padding-left: 5px}

.t1:hover{ color: #0000FF;text-decoration: underline } .t2:hover{ text-decoration : underline; color:#339900; }

.t3:hover { color: #9900CC; text-decoration: none} .t4:hover { color: #FF0099; text-decoration: none} .t5:hover { border: 1px #0000FF solid; height: 20px; color: #CCCC00} .t6:hover { border: solid; height: 0px; color: #0066FF; border-width: 0px 0px 1px; border-color: #00FF00 #00FF00 #00FF33 #00FF33} .t7:hover { border: #FF0000 solid; height: 0px; color: #990000; border-width: 0px 0px 1px; padding-bottom: 2px} .t8:hover { border: #FF0000 solid; height: 0px; color: #336600; border-width: 0px 0px 1px; width: 170px; text-align: center} .t9:hover { border: #FF0000 double; height: 0px; color: #0066FF; border-width: 0px 0px 5px} .t10:hover { border: 1px #0000FF solid; color: #333333; clip: height; background-color: #C8D8F0; height: 20px; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; width: 130px: 0px} .t11:hover { BORDER-RIGHT: #99CCFF 1px outset; PADDING-RIGHT: 2px; BORDER-TOP: #99CCFF 1px outset; PADDING-LEFT: 2px; PADDING-BOTTOM: 2px; BORDER-LEFT: #99CCFF 1px outset; PADDING-TOP: 2px; BORDER-BOTTOM: #99CCFF 1px outset;background-color:#C8D8F0; height: 25px; width: 150px; text-align: center; } .t12:hover{ text-decoration : none; color:#006699; ; height: 25px; width: 130px; padding-top: 4px; padding-right: 4px; padding-bottom: 4px; padding-left: 4px ; border: 1px #0000CC solid ; filter: Blur(Add=1, Direction=45, Strength=1) ; text-align: center } .txt10 { line-height: 15px}

</style> <script language="JavaScript"> <!-- function MM_preloadImages() { //v3.0 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++) if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}} } //--> </script> </head>

<body bgcolor="#EBEAF4" text="#000000" onLoad="MM_preloadImages('../testFile/bk4.gif','../testFile/bk3.gif','../testFile/bk2.gif','../testFile/bk1.gif')"> <table width="300" border="0" cellspacing="1" cellpadding="5" align="center" bgcolor="#CCCCCC"> <tr bgcolor="#FFFFFF" align="center"> <td colspan="2" class="txt10">CSS打造多彩文字链接</td> </tr> <tr bgcolor="#CCCCCC"> <td>一、</td> <td>初级链接样式</td> </tr> <tr bgcolor="#FFFFFF"> <td>1、</td> <td><a href=" http://www.ling18.cn" target=_blank class="t1">普通链接</a></td> </tr> <tr bgcolor="#FFFFFF"> <td>2、</td> <td><a href=" http://www.ling18.cn" target=_blank class="t2">无下划线链接</a></td> </tr> <tr bgcolor="#FFFFFF"> <td>3、</td> <td><a href=" http://www.ling18.cn" target=_blank class="t3">双划线链接</a></td> </tr> <tr bgcolor="#FFFFFF"> <td>4、</td> <td><a href=" http://www.ling18.cn" target=_blank class="t4">删除线链接</a></td> </tr> <tr bgcolor="#CCCCCC"> <td>二、</td> <td>进阶链接样式风格</td> </tr> <tr bgcolor="#FFFFFF"> <td>1、</td> <td><a href=" http://www.ling18.cn" target=_blank class="t5">另类下划线的原理</a></td> </tr> <tr bgcolor="#FFFFFF"> <td>2、</td> <td><a href=" http://www.ling18.cn" target=_blank class="t6">定制下划线色彩</a></td> </tr> <tr bgcolor="#FFFFFF"> <td>3、 </td> <td><a href=" http://www.ling18.cn" target=_blank class="t7">定制下划线距离</a></td> </tr> <tr bgcolor="#FFFFFF"> <td>4、 </td> <td><a href=" http://www.ling18.cn" target=_blank class="t8">定制下划线长度和对齐方式</a></td> </tr> <tr bgcolor="#FFFFFF"> <td>5、 </td> <td><a href=" http://www.ling18.cn" target=_blank class="t9">定制双下划线</a></td> </tr> <tr bgcolor="#CCCCCC"> <td>三、</td> <td>高级链接样式风格</td> </tr> <tr bgcolor="#FFFFFF"> <td>1、</td> <td><a href=" http://www.ling18.cn" target=_blank class="t10">定义块状链接</a></td> </tr> <tr bgcolor="#FFFFFF"> <td>2、</td> <td><a href=" http://www.ling18.cn" target=_blank class="t11">定义按钮风格的链接</a></td> </tr> <tr bgcolor="#FFFFFF"> <td>3、</td> <td><a href=" http://www.ling18.cn" target=_blank class="t12">定义特效链接</a></td> </tr> <tr bgcolor="#FFFFFF"> <td>4、</td> <td><a href=" http://www.ling18.cn" target=_blank class="t13">静态背景切换链接</a></td> </tr> <tr bgcolor="#FFFFFF"> <td>5、</td> <td><a href=" http://www.ling18.cn" target=_blank class="t14">动态背景切换链接</a></td> </tr> <tr bgcolor="#FFFFFF" align="right"> <td colspan="2"><a href=" http://www.ling18.cn">领地吧</a> http://www.ling18.cn 整理</td> </tr> </table> <p class="t2"> </p> </body> </html>

  • 2楼网友:摆渡翁
  • 2021-04-27 10:45

a:link {color: #FF0000} a:visited {color: #00FF00} a:hover {color: #FF00FF} a:active {color: #0000FF}

例子:

a.ABC:link {color: #FF0000} a.ABC:visited {color: #00FF00} a.ABC:hover {color: #FF00FF} a.ABC:active {color: #0000FF}

<a class="ABC" href="url">name</a>

我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯