12 个答案:
答案 0 :(得分:60)
我有另一种可能性。这当然是一种“更新”的技术,但对我的项目来说已经足够了。
只有在需要一个或两个边框时才有效。我从来没有用4个边界做过......说实话,我还不知道答案。
.your-item {
position: relative;
}
.your-item:after {
content: '';
height: 100%; //You can change this if you want smaller/bigger borders
width: 1px;
position: absolute;
right: 0;
top: 0; // If you want to set a smaller height and center it, change this value
background-color: #000000; // The color of your border
}
我希望这对你也有帮助,对我来说,这是一个简单的解决方法。
答案 1 :(得分:50)
不,没有。边框总是和元素一样高。
通过将单元格的内容包装在中,并对其应用高度/边框样式,可以达到相同的效果。或者通过在1像素宽的PNG中绘制一条正确高度的短垂直线,并将其作为背景应用于单元格:
background:url(line.png) bottom right no-repeat;
答案 2 :(得分:47)
是的,您可以在定义边框后设置线高,