我有一个DIV装满动态文本的容器.文本的长度可以不同.所述DIV容器具有一固定的高度,但没有宽度.
文本格式为CSS3多列文本宽度固定columns-width.
结果是n宽度为的列column-width.现在我想知道无论有多少列有或如何计算出width的DIV.
CSS代码:
.columnize{
float: left;
position: relative;
width: 840px;
overflow: hidden;
}
.columnize div{
-moz-column-width: 259px;
-webkit-column-width: 259px;
-moz-column-gap: 16px;
-webkit-column-gap: 16px;
height: 560px;
}
Run Code Online (Sandbox Code Playgroud)
HTML代码:
<div id="columnWrapper class="columnize">
<div id="content">
... content goes here ...
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
我试图用这样的JQuery获得宽度:
$('#content').width();
$('#content').innerWidth();
Run Code Online (Sandbox Code Playgroud)
除了Firefox之外,所有浏览器都返回而column-width不是REAL width.
任何想法如何获得列布局的宽度?