从超链接中删除所有样式/格式 [英] Remove ALL styling/formatting from hyperlinks

查看:199
本文介绍了从超链接中删除所有样式/格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建一个带有不同颜色( href 链接)的导航菜单。我希望颜色不会改变任何状态(悬停,访问等)。



我知道如何设置不同状态的颜色,但我想



任何建议?

a:hover , a:visited 等:

  a {
color:blue;
text-decoration:none; / *无下划线* /
}

您也可以使用 inherit value如果你想使用父类型的属性:

  body {
颜色:蓝色;
}
a {
color:inherit; / *链接的蓝色颜色* /
text-decoration:inherit; / *无下划线* /
}


I'm creating a navigation menu with words with different colors (href links). I would like the color NOT to change on any state (hover, visited etc).

I know how to set the the colors for the different states, but I would like to know the code to just leave the text color (and any other styling/formatting) as it is.

Any Suggestions?

解决方案

You can simply define a style for links, which would override a:hover, a:visited etc.:

a {
  color: blue;
  text-decoration: none; /* no underline */
}

You can also use the inherit value if you want to use attributes from parent styles instead:

body {
  color: blue;
}
a {
  color: inherit; /* blue colors for links too */
  text-decoration: inherit; /* no underline */
}

这篇关于从超链接中删除所有样式/格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆