您可以使用 border-right-width 属性控制边框的宽度。有没有办法将它的高度设置为 border-right-height?
例如:
首页|关于
但我想要 |短一点。
最佳答案
您不能随意设置 border
属性。但是,在这里使用伪元素可能会有用 ( see exaggerated live example ):
HTML(可能——其他配置也是可能的)
<div class="menu"><span>Home</span><span>About</span><span>Last</span></div>
CSS
.menu span {font-size: 2em; padding: 10px; position: relative;}
.menu span:after {content: ''; position: absolute; right: 0; top: .6em; bottom: .6em; width: 1px; background-color: black;}
.menu > span:last-child:after {display: none;}
关于html - 有没有办法设置边界线高度?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10420940/