How can I move my content below some floated divs?
本问题已经有最佳答案,请猛点这里访问。
我一直在尝试建立一个网站,这样我可以测试一些东西,在这个过程中,我试图把容器的
但我得到的结果是3个
所以我的问题是,如何更正页面布局?
我还有一个问题是,
1 2 3 4 5 6 7 8 9 10 | .square { width: 100px; height: 100px; display: flex; align-items: center; justify-content: center; background: #e3e3e3; float: left; margin: 40px 40px; } |
1 2 3 4 5 6 7 8 9 10 11 12 | Quadrado 1 Quadrado 2 Quadrado 3 <p> this paragraph should be under the div with the"container" class </p> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed a porttitor nisl. Praesent a nisl nec nisi interdum efficitur a nec metus. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed a porttitor nisl. Praesent a nisl nec nisi interdum efficitur a nec metus. |
将
1 2 3 4 5 6 7 8 9 10 | .square { width: 100px; height: 100px; display: flex; align-items: center; justify-content: center; background: #e3e3e3; float: left; margin: 40px 40px; } |
1 2 3 4 5 6 7 8 9 10 11 | Quadrado 1 Quadrado 2 Quadrado 3 <p style="clear: both;">this paragraph should be under the div with the"container" class </p> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed a porttitor nisl. Praesent a nisl nec nisi interdum efficitur a nec metus. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed a porttitor nisl. Praesent a nisl nec nisi interdum efficitur a nec metus. |
既然你已经在使用
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | .container { display: flex; justify-content: center; } .square { width: 100px; height: 100px; background: #e3e3e3; display: flex; align-items: center; justify-content: center; margin: 40px 40px; } |
1 2 3 4 5 6 7 8 9 10 11 12 | Quadrado 1 Quadrado 2 Quadrado 3 <p> this paragraph should be under the div with the"container" class </p> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed a porttitor nisl. Praesent a nisl nec nisi interdum efficitur a nec metus. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed a porttitor nisl. Praesent a nisl nec nisi interdum efficitur a nec metus. |