由于某些原因,访问的背景没有改变为灰色。有人知道怎么修吗?
a:link {
height: auto;
display: inline-block;
border-radius: 5px;
background: rgb(241,231,103);
background: linear-gradient(to bottom, rgb(241,231,103) 0%, rgb(241,231,103) 32%, rgb(248,217,54) 73%, rgb(253,208,22) 100%);
}
a:visited {
background-color: gray;
}
a:hover {
background: linear-gradient(to bottom, rgb(253,208,22) 0%, rgb(248,217,54) 27%, rgb(241,231,103) 68%, rgb(241,231,103) 100%);
}HTML文件,我需要在我的任务中使用css
<head>
<meta charset="UTF-8">
<title></title>
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<a href="http://www.stackoverflow.com">one</a>
<a href="#">two</a>
<a href="#">three</a>
<a href="#">seven</a>
</body>发布于 2015-11-27 01:44:06
尝试设置链接的默认背景颜色,例如white
a{
background-color: white;
}然后
a:visited {
background-color: gray;
}发布于 2015-11-27 01:34:35
a:visited不是实现这一点的完整证明方法。你可以用一个简短的jquery来实现。
jQuery
$('a').click(function(){
$('a').css('background-color','gray')
})上面的方法非常适合你的问题:)
发布于 2015-11-27 02:01:10
a:link {
height: auto;
display: inline-block;
border-radius: 5px;
background: red;
}使用这个
https://stackoverflow.com/questions/33944279
复制相似问题