如何设置嵌套在 DIV 包装器内的 DIV 的位置和尺寸?
我有以下 HTML 标记:
<div id="wrapper">
<div id="left-div"> [Content] </div>
<div id="top-right-div"> [Content] </div>
<div id="bottom-right-div"> [Content] </div>
</div>
left-div 的高度大于 top-right-div 和 bottom-right-div 的总高度。我希望 left-div 始终位于包装器的左侧,top-right-div 位于右上角,bottom-right-div 在右下角。
包装器是否也可以根据所有内部
s
的高度和宽度来调整其大小?我尝试设置绝对、浮动、显示和溢出,但无法获得所需的结果。预先感谢
更新
jsfiddle 用例: http://jsfiddle.net/sBSfp/
I have the following HTML markup:
<div id="wrapper">
<div id="left-div"> [Content] </div>
<div id="top-right-div"> [Content] </div>
<div id="bottom-right-div"> [Content] </div>
</div>
left-div has greater height than top-right-div and bottom-right-div together. I would like the left-div to be always on the left side of the wrapper, top-right-div at the top right and bottom-right-div at the bottom right.
Is it also possible for the wrapper to adjust its size depending on all the inner <div>s
height and width?
I tried by setting absolute, float, display and overflow but I cannot get to the desired result. Thanks in advance
UPDATE
jsfiddle use case: http://jsfiddle.net/sBSfp/
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我更新了小提琴来实现我理解你想要做的事情
http://jsfiddle.net/sBSfp/2/< /a>
如果不是所需的布局,请进一步描述。
I updated the fiddle to implement what I understnd you want to do
http://jsfiddle.net/sBSfp/2/
If it is not the desired layout please further describe it.