好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

CSS如何实现超链接背景切换_html/css_WEB-ITnose

CSS如何实现超链接背景切换:

相当数量的网站在导航栏都有如此效果:当鼠标放在导航栏目上,背景图片会发生变化,移开之后又会还原原来的背景图片。下面简单介绍一下如何实现此效果。代码实例如下:

      蚂蚁部落  div{  height:28px;  width:300px;  border-bottom:3px solid #E10001;}ul{  list-style:none;  margin:0px;  padding:0px;}ul li{  float:left;  width:87px;  height:28px;  margin-left:2px;  display:inline;}ul li a{  width:87px;  height:28px;  display:block;  font-size:14px;  text-align:center;  line-height:28px;  text-decoration:none;  color:#333;  background:url(mytest/demo/bg1.gif) no-repeat;}ul li a:hover{  background:url(mytest/demo/bg2.gif) no-repeat;}   

CSS专区 JS专区 HTML专区

查看更多关于CSS如何实现超链接背景切换_html/css_WEB-ITnose的详细内容...

  阅读:33次