<分区>
编辑问题以包含 desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem .这将有助于其他人回答问题。
关闭 8 年前。
<分区>
编辑问题以包含 desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem .这将有助于其他人回答问题。
关闭 8 年前。
所以我试图让我的导航栏列表项在每一侧都有一个边框,但我希望它们仍然像这样连接: http://prntscr.com/4wa4q4
当我尝试向两侧添加边框时,它们被隔开并且没有边距,每个列表项上的 2 个边框在一起。怎么才能像图片那样呢?
最佳答案
HTML:
<ul>
<li>one</li>
<li>two</li>
<li>three</li>
</ul>
CSS:
ul{
list-style: none;
}
ul li:first-child{
border-left: 1px solid gray;
}
ul li{
border-right: 1px solid gray;
display: table-cell;
padding: 5px 20px;
color: #FFF;
background: #000;
margin: 0;
}
关于html - 链接之间的导航栏分隔符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26372797/