html - 不透明度 :visited

标签 html css opacity

我无法在 Firefox 或 IE 中处理 a:visited 超链接

如果我设置 a:visited 的背景颜色,它会正常工作,但不透明度不会设置。

有什么想法吗?

这是我的CSS:

a.photo
{
    display: inline-block;
}
a.photo img
{
    border: 1px solid #C8C8C8;
    background-color: #ffffff;
}
a:hover.photo img, 
a:active.photo img {
    background-color: #FF2D59;
    border: 1px solid #FF2D59;
}
a:visited.photo img 
{
    opacity: 0.4;
    filter: alpha(opacity=40); /* For IE8 and earlier */
}
a.small img
{
    width: 80px;
    height: 80px;
    padding: 6px;
}


<a href="#" class="photo small">
    <img src="http://www.w3schools.com/css/klematis.jpg" alt="small photo hyperlink" />
</a>

我认为 CSS 的顺序没有任何问题,因为如果我添加背景颜色,它就可以正常工作:

a:visited.photo img 
{
    opacity: 0.4;
    filter: alpha(opacity=40); /* For IE8 and earlier */
    background-color: Gray;
}

最佳答案

SEC7115: :visited and :link styles can only differ by color. Some styles were not applied to :visited.

这来自 IE 的开发人员工具控制台。我很确定 Firefox 会显示类似的错误。

对不起。那里无能为力。

关于html - 不透明度 :visited,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9216164/

相关文章:

PHP CMS 教程,写出 html 文件

html - 如何控制CSS3动画的时序

javascript - 如何去除javascript中的不透明度?

css - 为什么悬停不起作用.CSS RGBA NOT WORKING

javascript - 在 Bootstrap 中使用 Active 类的问题

javascript - 如何在 Window.Blur () 事件上创建事件监听器?

javascript - 单击按钮时在 <td> 中显示计算的算术平均值

html - 如何防止行内 block 元素堆叠?

html - CSS边距调整帮助

jQuery .animate 不透明度回调函数