开发者

Vertical rule within a div

开发者 https://www.devze.com 2023-03-23 10:24 出处:网络
jsFiddle 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 mo开发者_StackOverfl

jsFiddle

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 mo开发者_StackOverflow中文版difying 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?


the padding needs to be a property of #vr Does this look right? http://jsfiddle.net/Gfn9U/4/


It's because of the padding in the wrapper

Make the top and bottom paddings 0px

#wrapper {
    padding-left: 10px;
    padding-right: 10px;
    padding-top: 0px;
    padding-bottom: 0px;
}
0

精彩评论

暂无评论...
验证码 换一张
取 消