a标签怎么去下划线以及实现点击前和点击后不变色
2016-06-16来源:易贤网

a标签在网页中经常会用到,其默认有下划线和点击前和点击后变色,现在的需求是如何让其不带下划线,以及点击不变色,下面有个不错的教程,大家可以参考下 

代码如下:

a:link { 

font-size: 12px; 

color: #000000; 

text-decoration: none; 

a:visited { 

font-size: 12px; 

color: #000000; 

text-decoration: none; 

a:hover { 

font-size: 12px; 

color: #999999; 

text-decoration: underline; 

这样定义样式表就可以实现你的功能了,不会样式表的话,可以把下面的代码加到你的页面中<head></head>标签里: 

代码如下:

<style type="text/css"> 

<!-- 

a:link { 

font-size: 12px; 

color: #000000; 

text-decoration: none; 

a:visited { 

font-size: 12px; 

color: #000000; 

text-decoration: none; 

a:hover { 

font-size: 12px; 

color: #999999; 

text-decoration: underline; 

--> 

</style> 

2026公务员·事业单位培训课程试听报名

  • 报班类型
  • 姓名
  • 手机号
  • 验证码
推荐信息