gpt4 book ai didi

CSS 无法正确对齐选项卡式菜单

转载 作者:行者123 更新时间:2023-11-28 19:09:58 25 4
gpt4 key购买 nike

您能帮我修复 IE7 中的菜单吗?

代码是:

<ul id="layer1">
<li id="current" >
<span><a href="/">Главная</a></span>
</li>



#menu {
margin-left:150px;
}
#menu ul#layer1 {
list-style-image:none;
list-style-position:outside;
list-style-type:none;
margin:0 auto;
padding:0;
}
#menu ul#layer1 li {
background:transparent url(/site_media/images/left.png) no-repeat scroll left top;
float:left;
margin-left:6px;
padding-bottom:6px;
padding-left:6px;
padding-top:4px;
}
#menu ul#layer1 li span {
background:transparent url(/site_media/images/right.jpg) no-repeat scroll right top;
margin-right:6px;
padding-bottom:6px;
padding-right:6px;
padding-top:4px;
}
#menu li a {
background-color:#BF1E2D;
color:#FFFFFF;
padding:4px 35px 6px;
text-decoration:none;
}
#menu ul#layer1 li#current span {
background:transparent url(/site_media/images/right-gray.png) no-repeat scroll right top;
}
#menu ul#layer1 li#current {
background:transparent url(/site_media/images/left-gray.png) no-repeat scroll left top;
}
#menu ul#layer1 li#current a {
background-color:#E3E3E3;
color:#BF1E2D;
}

您也可以在这里查看网站 http://j-in.org.ua:9000

最佳答案

移除 li 的顶部和底部 padding 并将 span 向左浮动:

#menu ul#layer1 li{
background: url(left.png) left top no-repeat;
margin-left:6px;
padding-left: 6px;
float: left;
}

#menu ul#layer1 li span{
background: url(right.jpg) right top no-repeat;
padding-right:6px;
margin-right: 6px;
padding-top: 4px;
padding-bottom: 6px;
float:left;
}

关于CSS 无法正确对齐选项卡式菜单,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1024388/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com