【发布时间】:2015-06-15 07:56:20
【问题描述】:
我想要的只是在屏幕左侧有一条小黑线,顶部和底部边框为 30 像素。
差不多就是这样,但如果我使用 %,我就不会有顶部和底部的 30 像素。
#border-right {
right:0;
width: 71px;
height: 94%;
top: 3%;
bottom: 3%;
position:fixed;
background:rgba(255,255,255,.9);
border-left:2px solid black;
z-index:1;
}
这就是我现在卡住的地方——https://jsfiddle.net/9o3t5u2d/
谢谢! F.
【问题讨论】:
-
是的@notulysses,但我希望顶部和底部边距为30px,而不是与页面高度相关联。编辑:那完美!我不知道 calc 选项,谢谢。
-
所以你想要一个 2px 的线到屏幕的右边缘,顶部和底部有 3% 的空白空间?为什么你有 71px 的宽度?或者你想要 30px 思考线在 2px 实线的顶部和底部?请澄清。
标签: html css border margin padding