html - 多种样式的翻转链接

标签 html css rollovers

我确信这是一个相当简单的修复,但我一直无法弄清楚。

我使用 Dreamweaver 中的页面属性为页面上的链接设计了 CSS,并且一切正常。我现在有一行需要更改几个链接的链接和悬停颜色。

<head>
<style type="text/css">
<!--
body {
background-color: #666666;
}

a:link {
color: #000000;
text-decoration: none;
}
a:visited {
text-decoration: none;
color: #000000;
}
a:hover {
text-decoration: none;
color: #666666;
}
a:active {
text-decoration: none;
color: #000000;
-->
</style>
</head>

我能够通过在正文中使用以下代码成功更改链接颜色。

<a href="url" target="_blank" style="color: rgb(20,80,153)">Website</a>

我未能成功完成的是更改翻转。我搜索并尝试了几种不同的方法来解决问题,但没有成功。有人可以指出我做错了什么或给我一个 CSS 应该是什么样子的例子吗?

最佳答案

给你的特殊链接special class :

CSS

.link
{
    color: rgb(20, 80, 153);
}

.link:hover{..}
.link:active{..}
.link:visited{..}

HTML

<a href="#" class="link">Website</a>

关于html - 多种样式的翻转链接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21147266/

相关文章:

html - CSS 图像翻转

css - 内部链接 <li> 无效

php - 是否可以在我指定时执行 PHP 代码,而不是在页面加载时执行

jquery - CSS3 动画从上一个位置继续

javascript - <object> 标记在 Chrome 中更改其数据属性时不会刷新

html - 在 css 中为两个不同的闪烁类创建两种不同的样式

html - Dart:如何更改按钮文本的颜色

html - 在 css 转换下消除 ul 高度的波动

html - 电子邮件模板的跨客户端 float