原创经验-为什么有些css代码没作用

为什么有些css代码没作用,比如下列代码,和排列有关.把css代码使用顺序换一下就可以了.

以下好像就是一段错误的代码-----

<style type ="text/css">
<!-
a:hover{text-decoration:underline;color:blue}
a:link{text-decoration:underline;color: red}
a:visited{text-decoration:green}
->
</style>

 <a href="http://www.hiaimi.cn/">爱米</a>

这是正确的代码---------

<style type ="text/css">
<!-
a:link{text-decoration:underline;color: red}

a:hover{text-decoration:underline;color:blue}
a:visited{text-decoration:green}
->
</style>

 <a href="http://www.hiaimi.cn/">爱米</a>

为什么它回这样

1,首先有链接---没有有链接,还有鼠标在上面的效果?

2,第二步才能有鼠标在上面的效果------鼠标没有在上面或者没有取得焦点,怎么能有后面的点击后的效果?

3,最后才有点击后的效果。

呵呵,说得不很切切,明白意思就OK。

posted @ 2009-11-05 13:41  雨城  阅读(506)  评论(1编辑  收藏  举报