好得很程序员自学网

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

css+html实现自适应宽度的菜单学习_html/css_WEB-ITnose

本文是利用css和html实现自适应于文本长度菜单。

实现后的效果图,如下:






实现代码如下:


          menu4.html 	                         a{  display: block;  height:38px;  /* width:107px; */  /* line-height: 2; */  line-height: 38px;  text-align: center;  background: url(./c2.jpg) no-repeat 0px 0px;  color:#d84700;  font-size: 14px;  weight:bold;  text-decoration: none;  padding-left: 18px;  float:left;  margin:5px;}a span{  display: block;  background: url(./c2.jpg) no-repeat right 0px;  padding-right: 20px;}a:hover{  background: url(./c2.jpg) no-repeat 0px -38px;}a:hover span{  background: url(./c2.jpg) no-repeat right -38px;}              

免费注册 登入 在网上开店

查看更多关于css+html实现自适应宽度的菜单学习_html/css_WEB-ITnose的详细内容...

  阅读:36次