【发布时间】:2013-01-30 12:50:54
【问题描述】:
我正在尝试实现以下布局:
+--------------------+ +-------------------+ +--------------------+
| Right column with | | small center with | | Right column with |
| multiple lines and | | fixed width | | multiple lines and |
| width of | | | | width of |
| (100%-center)/2 | | | | (100%-center)/2 |
+--------------------+ +-------------------+ +--------------------+
但是使用我当前的标记,当它的内容变得太大而无法容纳该行时,右列将移动到其余部分下方,而不是在其自身内部引入换行符:
+--------------------+ +-------------------+
| Right column with | | small center with |
| multiple lines and | | fixed width |
| width of | | |
| (100%-center)/2 | | |
+--------------------+ +-------------------+
+-------------------------------------------+
| Right column with multiple lines and... |
+-------------------------------------------+
这是我当前的标记:
<div style="text-align: center;">
<span style="float: left;">left</span>
<span>center</span>
<span style="float: right;">right</span>
</div>
如何实现所需的布局?谢谢!
【问题讨论】:
-
你为你的跨度设置了宽度吗?
-
不,左右跨度应该占据所有可用空间(即(100%-(中心宽度))/2)
-
不知道如何在不定义中心 div 的情况下制作它,这里是 %:jsfiddle.net/UPwJ8
标签: html css css-float word-wrap multiple-columns