如何使流动文本扩展并适合div而不指定高度 [英] How to make flowing text extend and fit the div without specifying a height

查看:99
本文介绍了如何使流动文本扩展并适合div而不指定高度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有文字需要在身体的div框内流动的结构。但似乎我不能得到它的工作。也许我做了一些错误的位置:标签?



这是小提琴: http://jsfiddle.net/Tf5Z8/



这就是我希望能够实现的目标: http://oi58.tinypic.com/332njm9.jpg 因此,随着文本不断增加(更少或更多),它保持底部完好并相应调整div的大小。现在我已将#bodyContainer设置为height:300px;

  #bodyContainer {width:1024px;高度:300像素;保证金:汽车;背景色:#f4f3e7;填充顶:20像素; } 

但我不想这么做,因为会有很多页面的文字量不同。



感谢百万,干杯。 更改 #bodyContainer height auto 。像这样: JSFiddle


I have structure where in the text needs to flow within the div box in the body. but seems like i cant get it to work. Maybe i am doing something wrong with the position: tag?

Here is the fiddle: http://jsfiddle.net/Tf5Z8/

and this is what i was hoping to accomplish: http://oi58.tinypic.com/332njm9.jpg so that as text keeps getting added (less or more), it keeps the bottom intact and resizes the div accordingly. Right now i have the #bodyContainer set to height:300px;

#bodyContainer { width:1024px; height:300px; margin:auto; background-color:#f4f3e7; padding-top:20px;  }

but i don't want to do this since there would be many pages with different text amount.

Thanks a million, Cheers.

解决方案

Change the #bodyContainer height to auto. Like this: JSFiddle

这篇关于如何使流动文本扩展并适合div而不指定高度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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