gpt4 book ai didi

html - 如何去掉右边框

转载 作者:太空宇宙 更新时间:2023-11-04 13:18:33 24 4
gpt4 key购买 nike

你们知道如何删除下拉菜单的右边框吗?我尝试放置right-border: noneright-border: hiddenright-border: 0px 但什么都没有!

HTML:

<section class="menu">
<ul>
<li><a class="active" href="#"> PORTFOLIO </a>
<ul>
<li><a href="#"> illustrations </a></li>
<li><a href="#"> portraits </a></li>
<li><a href="#"> environments </a></li>
<li><a href="#"> life drawings </a></li>
</ul>
</li>

<li><a href="#"> STORE </a>
<ul>
<li><a href="#" target="_blank"> society6 </a></li>
<li><a href="#" target="_blank"> redbubble </a></li>
</ul>
</li>
<li><a href="#"> CONTACT </a></li>
<li><a href="#"> ABOUT </a></li>
</ul>

</section>

CSS:

.menu {
height:29px;
width:100%;
/*background:orange;*/
}

.menu ul {
width:auto;
list-style-type:none;
font-family:"calibri", "arial";
}

.menu ul li {
position:relative;
display:inline;
float:left;
width:auto;
border-right: 2px solid purple;
margin-left:10px;
line-height:12px;
}

.menu ul li a {
display:block;
padding:3px;
color:#854288;
text-decoration:none;
font-size:20px;
font-weight:strong;
padding-right:25px;

}

.menu ul li a:hover, .active {
color:#788d35
}

.menu ul li ul {
display:none;
}

.menu ul li:hover > ul {
display:block;
position:absolute;
top:23px;
float:left;
padding-left:20px;
text-align:left;
margin-left: -30px;

}

.menu ul li ul li {
position:relative;
min-width:135px;
max-width:1350px;
width:100%;
}

.menu ul li ul li a {
padding: 3px;
margin-left: 1px;
border-right: hidden; /* <---- DOES NOT WORK */
}

最佳答案

这会从主菜单中删除 border(在最后一项 About 之后):

.menu ul li:last-child{ border:none; }

JSFiddle

如果您还想从嵌套的 li 中删除 border,您应该将 border:none 添加到 .menu ul li ul li :

JSFiddle

关于html - 如何去掉右边框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24231810/

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