本文由我司收集整编,推荐下载,如有疑问,请与我司联系
如何对齐3个div左中右?[重复]
2013/02/28 42933 How can I align 3 divs in one line left-center-right without having to define explicit sizes?
如何在左中右一行中对齐3个div而不必定义显式大小?
Left should be aligned most to the left edge, and right to the right edge.
左边应该与左边缘对齐,右边边缘对齐。
The following does not work:
以下不起作用:
div left /div div right /div div center /div 16
Add a wrapper div and give text-align:center
添加包装器div并给出text-align:center
CSS
CSS
.wrap{ text-align:center HTML
HTML
div div left /div div right /div div center sdv dg sdb sdfbh sdfhfdhh h dfh /div /div DEMOtext align center
DEMO
2
Heres an example of how to do this by placing the floats in the correct order.
下面是一个如何通过以正确的顺序放置浮动来执行此操作的示例。
jsFiddle Example
jsFiddle示例
div left /div div right /div div center /div 0
It’s not possible actually do it, without knowing about the content and layout pattern. But for a begining point, you can try this:
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论