39,084
社区成员
发帖
与我相关
我的任务
分享
.head{ position:fixed; left:0; bottom:0; z-index:10; width:100%; height:44px; background:#EFEFEF; border-top:1px solid #cacaca; font-size:16px; opacity:0.80;}
.head_search,.head_fav,.head_fav_y{ float:left; overflow:hidden; width:44px; height:44px; border-right:1px solid #cacaca; background:url(../images/icon.png) 0 0 no-repeat; font:0/100em Tahoma;}
.head_fav,.head_fav_y{ background:url(../images/icon.png) -132px -96px no-repeat; font:12px/68px 'microsoft yahei'; text-align:center; color:#666;}
.head_fav_y{ color:#ff9600; background:url(../images/fav.png) 0 -8px no-repeat;}
.head_my,.head_list{ float:right; overflow:hidden; width:44px; height:44px; border-left:1px solid #cacaca; background:url(../images/icon.png) 0 -88px no-repeat; font:0/100em Tahoma;}
.head_list{ background:url(../images/icon.png) 0 -45px no-repeat;}
.head_menu{ position:absolute; left:44px; right:44px; top:-1px; overflow:hidden; display:flex; border:1px solid #cacaca; border-right:none;}
.head_menu a{ display:block; flex:1; position:relative; border-right:1px solid #cacaca; height:43px; line-height:46px; padding-bottom:3px; text-align:center;}
<header>
<div class="head">
<a href="${ctx}/goods/allcategory" title="" class="head_search"></a>
<div class="head_menu">
<a href="${ctx}/index" title="">菜单1</a>
<a href="${ctx}/goods/allcategory" title="">菜单2</a>
<a href="${ctx}/cart/list" title="">菜单3</a>
</div>
</div>
</header>
.head{ position:fixed; left:0; bottom:0; z-index:10; width:100%; height:44px; background:#EFEFEF; border-top:1px solid #cacaca; font-size:16px; opacity:0.80;}
.head_search,.head_fav,.head_fav_y{ position:absolute; left:0; top:0; z-index:11; overflow:hidden; width:44px; height:44px; border-right:1px solid #cacaca; background:url(../images/icon.png) 0 0 no-repeat; font:0/100em Tahoma;}
.head_fav,.head_fav_y{ background:url(../images/icon.png) -132px -96px no-repeat; font:12px/68px 'microsoft yahei'; text-align:center; color:#666;}
.head_fav_y{ color:#ff9600; background:url(../images/fav.png) 0 -8px no-repeat;}
.head_my,.head_list{ position:absolute; right:0; top:0; z-index:11; overflow:hidden; width:44px; height:44px; border-left:1px solid #cacaca; background:url(../images/icon.png) 0 -88px no-repeat; font:0/100em Tahoma;}
.head_list{ background:url(../images/icon.png) 0 -45px no-repeat;}
.head_menu{ margin:-1px 44px 0 44px; overflow:hidden; display:flex; border:1px solid #cacaca; border-right:none;}
.head_menu ul{ width:100%; margin-left:-1px;}
.head_menu li{ float:left; width:33.3%;}
.head_menu a{ display:block; flex:1; position:relative; height:43px; border-left:1px solid #cacaca; line-height:46px; padding-bottom:3px; text-align:center;}
.head_menu .nobor a{ border-left:none;}
这样就好了[/quote]
慢慢写,细心学习宽度是自动适应的。没有设置呢。。 [quote=引用 3 楼 xmt1139057136 的回复:] 三个菜单宽度分别设置小一点
.head{ position:fixed; left:0; bottom:0; z-index:10; width:100%; height:44px; background:#EFEFEF; border-top:1px solid #cacaca; font-size:16px; opacity:0.80;}
.head_search,.head_fav,.head_fav_y{ position:absolute; left:0; top:0; z-index:11; overflow:hidden; width:44px; height:44px; border-right:1px solid #cacaca; background:url(../images/icon.png) 0 0 no-repeat; font:0/100em Tahoma;}
.head_fav,.head_fav_y{ background:url(../images/icon.png) -132px -96px no-repeat; font:12px/68px 'microsoft yahei'; text-align:center; color:#666;}
.head_fav_y{ color:#ff9600; background:url(../images/fav.png) 0 -8px no-repeat;}
.head_my,.head_list{ position:absolute; right:0; top:0; z-index:11; overflow:hidden; width:44px; height:44px; border-left:1px solid #cacaca; background:url(../images/icon.png) 0 -88px no-repeat; font:0/100em Tahoma;}
.head_list{ background:url(../images/icon.png) 0 -45px no-repeat;}
.head_menu{ margin:-1px 44px 0 44px; overflow:hidden; display:flex; border:1px solid #cacaca; border-right:none;}
.head_menu ul{ width:100%; margin-left:-1px;}
.head_menu li{ float:left; width:33.3%;}
.head_menu a{ display:block; flex:1; position:relative; height:43px; border-left:1px solid #cacaca; line-height:46px; padding-bottom:3px; text-align:center;}
.head_menu .nobor a{ border-left:none;}
这样就好了宽度是自动适应的。没有设置呢。。 三个菜单宽度分别设置小一点
三个菜单宽度分别设置小一点
手机还是竖着排版比较好