div 内的垂直线
我在 div 中有一条“垂直规则”(实际上是 border-right)。然而,我很难让它跨越整个容器。我尝试修改边距(尝试删除
#vr
中 margin-top: 20px;
的注释,但无济于事。
另外,我该如何制作 #wrapper
扩展以适应其内容?
:抱歉,我正在尝试解决 #wrapper
中的填充问题,因为它对于其他事情是必要的。
编辑 一个href="http://jsfiddle.net/Gfn9U/5/" rel="nofollow">我已经解决了:或者有更干净的方法吗?
I have a "vertical rule" within a div (actually the border-right
of a nested div). However, I am having trouble making it span the whole of its container. I have tried modifying the margins (try removing the comments from margin-top: 20px;
in the #vr
but to no avail.
Also, how do I make the #wrapper
expand to fit its contents?
EDIT: Sorry, I was unclear. I am trying to work around the padding in the #wrapper
because it's necessary for other things.
EDIT: I've worked it out: or is there a cleaner way?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
填充需要是 #vr 的属性 这看起来正确吗? http://jsfiddle.net/Gfn9U/4/
the padding needs to be a property of #vr Does this look right? http://jsfiddle.net/Gfn9U/4/
这是因为包装器中的填充
使顶部和底部填充为0px
It's because of the padding in the wrapper
Make the top and bottom paddings 0px