Home  >  Article  >  Web Front-end  >  为什么a:visited失效了呢?_html/css_WEB-ITnose

为什么a:visited失效了呢?_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 12:17:361416browse

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title></title><meta http-equiv="Content-Type" content="text/html;charset=utf-8"><style type="text/css">.link a:link{	color:blue;}.link a:visited{	color:yellow;}.link a:hover{	color:red;}.link a:active{	color:#ccc;}</style></head><body><div id="webmanage">	<ul>		<li class="link"><a href="__ROOT__category" target="dashbord">栏目一</a></li>		<li class="link"><a href="__ROOT__article/lists" target="dashbord">栏目二</a></li>		<li class="link"><a href="__ROOT__article/add" target="dashbord">栏目三</a></li>		<li class="link"><a href="__ROOT__member/reg" target="dashbord">栏目四</a></li>	</ul></div>	</body></html>

为什么这段代码不能实现:鼠标没点就是蓝色,点了之后就是黄色,再点第二个,第二个就是黄色,前一个恢复蓝色???  

        我发现主要是1.visited这里有问题?2.打开该页面,并不是都是为蓝色?


回复讨论(解决方案)

.link a:link{    color:blue;}a:visited{    color:yellow;}a:hover{    color:red;}a:active{    color:#ccc;}

去掉前面的.link

第一个也要去掉,打错了。

你把这个a属性用不同的类分开,然后设置他的属性。比如:





  • css:
    .a a:link{}
    .b a:link{}
    .c a:link{}
    .d a:link{}
    应该就会得到你想要的效果
    Statement:
    The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn