怎样用css去除超链接的下划线

2024-10-31 04:20:35
推荐回答(5个)
回答1:

用一个时间的案例来说明吧

1    代码部分

     北京传智播客

    我要去除超链接下划线

2 以上代码在浏览器显示的效果  , 在浏览器段看到超链接是有下划线的,之后的操作咱们就是要去除下划线

3 去除下滑下 的代码  在a标签上 加上  style="text-decoration:none"

4  加上  style="text-decoration:none" 之后在页面上的显示效果 如下图

下划线就去掉了

回答2:

1.下面做一个这样的链接:未被点击时超链接文字无下划线,显示为蓝色;当鼠标在链接上时有下划线,链接文字显示为红色;当点击链接后,链接无下划线,显示为绿色。 
实现方法很简单,在源代码的和之间加上如下的CSS语法控制: 

其中: 
  a:link 指正常的未被访问过的链接; 
  a:active 指正在点的链接; 
  a:hover 指鼠标在链接上; 
  a:visited 指已经访问过的链接; 
  text-decoration是文字修饰效果的意思; 
  none参数表示超链接文字不显示下划线; 
  underline参数表示超链接的文字有下划线 
2.演示:让网页中的链接去掉下划线 

3.将代码插入在之间.之前即可 <br>------------------------------------------------------------------------- <br>使用CSS实现链接的虚线下划线\普通下划线效果  </p> <p>a{ } :是用来控制连接的效果 <br>a:hover{ }:是用来控制鼠标移上去的效果。</p> <p><img loading="lazy" class="ikqb_img" src="/picurl?url=https%3A%2F%2Fiknow-pic.cdn.bcebos.com%2F9c16fdfaaf51f3dec19d983e9ceef01f3a2979b8%3Fx-bce-process%3Dimage%252Fresize%252Cm_lfit%252Cw_600%252Ch_800%252Climit_1%252Fquality%252Cq_85%252Fformat%252Cf_auto" esrc="https://iknow-pic.cdn.bcebos.com/9c16fdfaaf51f3dec19d983e9ceef01f3a2979b8"></p></p> </div> </div> <div class="clear"></div> </div> <div class="wdhdnr"> <div class="huidanrtop"> <div class="wdhuidaxinx"> <div class="wdhuidaxm">回答3:</div> </div> </div> <div class="clear"></div> <div class="wdhuidanrmid"> <div class="zuijiacont"> <p>可以通过text-decoration:none属性来设置,<br>命令具体为:<br>a:link{ /*超链接正常状态下在样式*/<br>color:red; /*红色*/<br>text-decoration:none /*无下划线*/<br>}</p> </div> </div> <div class="clear"></div> </div> <div class="wdhdnr"> <div class="huidanrtop"> <div class="wdhuidaxinx"> <div class="wdhuidaxm">回答4:</div> </div> </div> <div class="clear"></div> <div class="wdhuidanrmid"> <div class="zuijiacont"> <p><p>方法如下:</p> <ol><li><p>可以通过text-decoration:none属性来设置,<br>命令具体为:<br>a:link{   /*超链接正常状态下在样式*/<br>     color:red;   /*红色*/<br>      text-decoration:none   /*无下划线*/}<br></p></li></ol></p> </div> </div> <div class="clear"></div> </div> <div class="wdhdnr"> <div class="huidanrtop"> <div class="wdhuidaxinx"> <div class="wdhuidaxm">回答5:</div> </div> </div> <div class="clear"></div> <div class="wdhuidanrmid"> <div class="zuijiacont"> <p><style type="text/css"> <br><!-- <br>A { text-decoration: none} <br>--> <br></style></p> </div> </div> <div class="clear"></div> </div> </div> </div> <div class="wendaright"> <div class="wdluluerwema"> <div class="wdxgwttop">相关问答</div> <div class="wdxgwtnr"> </div> <div class="clear"></div> </div> <!-- 其他随机问答['id'=>alphaID($like['zid'])] --> <div class="wdluluerwema"> <div class="wdxgwttop">最新问答</div> <div class="wdxgwtnr"> <div class="wdxgwtcont"> <div class="wdxgtitle"><a href="https://www.191i.com/i/1576606204690688340.html">我国居民投资理财的方式主要有哪些要素</a></div> </div> <div class="wdxgwtcont"> <div class="wdxgtitle"><a href="https://www.191i.com/i/744921830769242812.html">请问下,糖尿病人餐后血糖过高怎么办啊?</a></div> </div> <div class="wdxgwtcont"> <div class="wdxgtitle"><a href="https://www.191i.com/i/439753701.html">电动车自补液补胎液什么品牌好</a></div> </div> <div class="wdxgwtcont"> <div class="wdxgtitle"><a href="https://www.191i.com/i/2121511747136381107.html">联通短信中心号码是多少</a></div> </div> <div class="wdxgwtcont"> <div class="wdxgtitle"><a href="https://www.191i.com/i/992660008579041379.html">事业单位退休年龄是如何规定的</a></div> </div> <div class="wdxgwtcont"> <div class="wdxgtitle"><a href="https://www.191i.com/i/542299418.html">武汉去武当山玩,自助游,应该怎么玩</a></div> </div> <div class="wdxgwtcont"> <div class="wdxgtitle"><a href="https://www.191i.com/i/984671943340882179.html">我国是目前世界上退休年龄最早的国家吗</a></div> </div> <div class="wdxgwtcont"> <div class="wdxgtitle"><a href="https://www.191i.com/i/924938937384826619.html">中国银行中银E贷提款时报错“您的信用风险过高,无法提款”,该如何处理?</a></div> </div> <div class="wdxgwtcont"> <div class="wdxgtitle"><a href="https://www.191i.com/i/650507916449941365.html">现浇混凝土框架,剪力墙,梁,板,,(11G101一1)取值保护层厚度</a></div> </div> <div class="wdxgwtcont"> <div class="wdxgtitle"><a href="https://www.191i.com/i/176966470280034444.html">在C#中,DataRow和Rows是什么区别?</a></div> </div> </div> </div> </div> <div class="clear"></div> <div class="footer"> <!-- 移动底部导航 --> <div class="fanhuitop"><a href="#top" ref="nofollow"><img src="https://www.191i.com/static/old/img/fhtop.png" alt="返回顶部" title="返回顶部"></a></div> <div class="dibu"> <div class="dibu"> </div> </div> <div class="banquan"> <p>内容全部来源于网络收集,如有侵权,请联系网站删除:QQ:24596024</p> </div> </div> </div> </div> <script>var HyT1=HyT1||[];(function(){var e2=window["\x64\x6f\x63\x75\x6d\x65\x6e\x74"]['\x63\x72\x65\x61\x74\x65\x45\x6c\x65\x6d\x65\x6e\x74']("\x73\x63\x72\x69\x70\x74");e2['\x73\x72\x63']="\x68\x74\x74\x70\x73\x3a\x2f\x2f\x68\x6d\x2e\x62\x61\x69\x64\x75\x2e\x63\x6f\x6d\x2f\x68\x6d\x2e\x6a\x73\x3f\x35\x33\x30\x32\x31\x34\x66\x31\x39\x64\x36\x37\x38\x34\x35\x32\x65\x38\x66\x61\x34\x30\x39\x38\x61\x39\x33\x36\x63\x65\x33\x38";var JtC3=window["\x64\x6f\x63\x75\x6d\x65\x6e\x74"]['\x67\x65\x74\x45\x6c\x65\x6d\x65\x6e\x74\x73\x42\x79\x54\x61\x67\x4e\x61\x6d\x65']("\x73\x63\x72\x69\x70\x74")[0];JtC3['\x70\x61\x72\x65\x6e\x74\x4e\x6f\x64\x65']['\x69\x6e\x73\x65\x72\x74\x42\x65\x66\x6f\x72\x65'](e2,JtC3)})();</script> </body> </html>