防止div包装 [英] prevent div wrapping

查看:76
本文介绍了防止div包装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Gang,


我不太确定之前是否发布了这个。我有搜查google群组的b $ b,无法找到任何内容。我试图设置一个包含div列的容器div(生成一个

电子表格。每个单元格可以包含文本或对象我的

问题是,当我生成在容器div的宽度

之外运行的列时,下面的div'的换行。我试过使用

< nobrtags," white-space:nowrap"在容器样式中,但没有什么

似乎有用。任何帮助都会非常感激。下面是

例如:

< div style =" white-space:nowrap; width:350px;">

< div style =" ; float:left; width:100px;"> 1st Column< / div>

< div style =" float:left; width:100px;"> 2nd column< / div>

< div style =" float:left; width:100px;"> 3rd Columnt< / div>

< div style =" float:left; width:100px;"> 4th Columnt< / div>

< div style =" width:100px;保证金:0 0 0 400;"> 5th Columnt< / div>

< / div>


最终发生的事情是第4栏(并且只有第4列)

被包裹到下一行。我想阻止

发生。任何建议表示赞赏。顺便说一句,我还要求b $ b尝试用span'替换内部div'并且没有变化。


谢谢,


Dave

Gang,

I am not quite sure if this has been posted before. I have
searched google groups and couldn''t find anything. I am trying to
setup a container div that contains columns of divs (to generate a
"spreadsheet". Each "cell" can contain either text or an object. My
problem is that when I generate columns that run outside of the width
of the container div, the following div''s wrap. I have tried using
<nobrtags, "white-space: nowrap" in the container style, but nothing
seems to work. Any help would greatly be appreciated. Below is an
example:
<div style="white-space: nowrap; width: 350px;">
<div style="float: left; width: 100px;">1st Column</div>
<div style="float: left; width: 100px;">2nd column</div>
<div style="float: left; width: 100px;">3rd Columnt</div>
<div style="float: left; width: 100px;">4th Columnt</div>
<div style="width: 100px; margin: 0 0 0 400;">5th Columnt</div>
</div>

What ends up happening is that 4th column (and only the 4th column)
gets wrapped to the next line. I would like to prevent that from
happening. Any suggestions are appreciated. By the way, I have also
tried replacing the inside div''s with span''s and had no change.

Thanks,

Dave

推荐答案

他****** @ yahoo.com 写道:

>

< div style =" white-space:nowrap;宽度:350px;">

< div style =" float:left; width:100px;"> 1st Column< / div>

< div style =" float:left; width:100px;"> 2nd column< / div>

< div style =" float:left; width:100px;"> 3rd Columnt< / div>

< div style =" float:left; width:100px;"> 4th Columnt< / div>

< div style =" width:100px;保证金:0 0 0 400;"> 5th Columnt< / div>

< / div>


最终发生的事情是第4栏(并且只有第4列)

被包裹到下一行。我想阻止

发生。任何建议表示赞赏。顺便说一句,我还试图用bt替换内部div'并且没有变化。
>
<div style="white-space: nowrap; width: 350px;">
<div style="float: left; width: 100px;">1st Column</div>
<div style="float: left; width: 100px;">2nd column</div>
<div style="float: left; width: 100px;">3rd Columnt</div>
<div style="float: left; width: 100px;">4th Columnt</div>
<div style="width: 100px; margin: 0 0 0 400;">5th Columnt</div>
</div>

What ends up happening is that 4th column (and only the 4th column)
gets wrapped to the next line. I would like to prevent that from
happening. Any suggestions are appreciated. By the way, I have also
tried replacing the inside div''s with span''s and had no change.



Do数学。 100 + 100 + 100 + 100 = 400即350.


-

jmm(连字符)列表(at)sohnen-moe(dot)com

(删除电子邮件的.AXSPAMGN)

Do the math. 100 + 100 + 100 + 100 = 400 which is 350.

--
jmm (hyphen) list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)


he******@yahoo.com 写道:

< div style =" width:100px; margin:0 0 0 400;"> 5th Columnt< / div>
<div style="width: 100px; margin: 0 0 0 400;">5th Columnt</div>



400个苹果?

-

Johannes Koch

in te domine speravi;非永久性的东西。

(Te Deum,4美分。)

400 apples?
--
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.)


Jim Moe写道:
Jim Moe wrote:

>< div style =" white-space:nowrap;宽度:350px;...
><div style="white-space: nowrap; width: 350px;"...



算一算。 100 + 100 + 100 + 100 = 400即350.

Do the math. 100 + 100 + 100 + 100 = 400 which is 350.



为什么不省略width:350px总而言之,让浏览器执行

数学运算?


因为不能使用浮点数的宽度不行,所以

到账。我想,这是因为浮动的元素从文件的正常流量中取出了




由于这个原因,我找不到其他方法使用表格

这个布局正确:-(


干杯

Daniel

So why not omit the "width:350px" altogether and let the browser do the
maths?

Because that does not work out as the widths of the floats are not taken
into account. I think, this is because floated elements are take out of
the normal flow of the document.

For that very reason, I found no other way than to use a table for
getting this layout right :-(

Cheers
Daniel


这篇关于防止div包装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆