./img/visited.gif图
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>css链接</title>
<style type="text/css">
* {padding: 0;margin: 0;}
body { font-family: "Myriad Pro", Frutiger, "Lucida Grande", "Lucida Sans", "Lucida Sans Unicode", Verdana, sans-serif; font-size: 1em; }
/* visited links ================================== */
ul { list-style:none; }
li { margin: 5px 0; }
li a { display: block; width: 300px; height: 30px; line-height: 30px; color: #000; text-decoration: none; text-indent: 10px; background: #94B8E9 url(./img/visited.gif) no-repeat left top;}
li a:visited { background: #94B8E9 url(./img/visited.gif) no-repeat right top;} </style>
</head>
<body>
<ul>
<li><a href="#">Andy Budd's Blogography</a></li>
<li><a href="#">Stuff and Nonsense</a></li>
<li><a href="#">Hicks Design</a></li>
<li><a href="#">Clagnut</a></li>
<li><a href="dog.com/">HTML Dog</a></li>
<li><a href="#">Adactio</a></li>
<li><a href="#">All In The Head</a></li>
<li><a href="#">Mark Boulton</a></li>
<li><a href="#">Ian Lloyd</a></li>
</ul>
</body>
</html>
效果图
为什么a:visited 背景图片无法显示? li a:visited { background: #94B8E9 url(./img/visited.gif) no-repeat right top;}
额,你这个是想做选中效果么? 如果是选中效果想长时间记录用户的选择项其实还是通过log表做选择日志记录用户的操作,然后通过后端返回选项,用后端配合jquery来实现应该会比较实际。
单纯通过CSS实现好像无法很完好的实现这种效果,不过不是很懂你的具体需求只是给个建议。
上述的问题可以看看是不是图片定位的问题或者图片是否存在。《CSS教程》 可以参考一下这本教程