CSS:定位 div
我怎样才能让我的 div 布局如下图所示。
-------------- -------------------
| | | Div2 |
| | -------------------
| Div1 | -------------------
| | | Div3 |
| | -------------------
| | -------------------
| | | Div4 |
-------------- -------------------
我尝试过的所有 div 的 2,3,4 彼此水平排列。我试着做清楚:左; (或两者)但它们只是最终位于 div 1 下。感谢您的帮助!
how can I get my divs to layout out like the below pic.
-------------- -------------------
| | | Div2 |
| | -------------------
| Div1 | -------------------
| | | Div3 |
| | -------------------
| | -------------------
| | | Div4 |
-------------- -------------------
Everything I've tried has div's 2,3,4 lining up horizontally to each other. I tried to do clear: left; (or both) but they just end up under div 1. Thanks for the help!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
我很可能在右侧有一个容器 div,其中嵌套了三行。
I'd most likely have a container div for the right side, with the three rows nested within it.
许多可能的解决方案之一:
边框只是为了帮助查看 div。
One of many possible solutions:
The
border
is there just to aid in seeing the divs.像这样的东西会起作用,基本上,该方法是将元素简单地放置在您需要的位置,IMO,这是理解页面基本布局的简单方法。 在这里您可以看到一个示例http://jsbin.com/izosi3/edit
Something like this will work, basicaly the approach is to simply position the elements where you need them, IMO this is an easy way to understand the base layout of your page. here you can see an example http://jsbin.com/izosi3/edit
演示怎么样
Html
Css
:http://www.jsfiddle.net/gaby/em7yz/2/
How is that
Html
Css
demo: http://www.jsfiddle.net/gaby/em7yz/2/
你可以做这样的事情。但是您必须明确设置 DIV 的高度。
You could do something like this. But you'll have to explicitly set the height of your DIV's.