小白提问 div高度不能随内部内容扩展
css吧
全部回复
仅看楼主
level 1
L9025 楼主
代码如下
chrome中效果
内容溢出了,我没有对div设置height,对流体布局来说,div高度应该随内容增加而扩展,可是这里没有扩展,内容直接溢出了。
我哪里存在问题呢,请大家告知
谢谢
2015年01月31日 15点01分 1
level 11
overflow:hidden;
2015年01月31日 16点01分 2
overflow:hidden 隐藏了溢出内容,我希望这些内容不隐藏,而是把div高度撑开,显示在div内部
2015年02月01日 04点02分
level 6
使用块内元素,
2015年02月01日 02点02分 3
level 1
height:auto;
2015年02月01日 04点02分 4
无效果
2015年02月01日 05点02分
@L9025 overflow-y:auto;还是不行?display:inline-block;在不行。我也不知道了。。。
2015年02月01日 05点02分
@顺139 你那个字体怎么超出来了?一开始我也认真看图。我手机党。在加上这个自动换行。。word-wrap:break-word;
2015年02月01日 05点02分
@顺139 没认真看图
2015年02月01日 05点02分
level 1
WIDTH的30%换成固定的宽度试试?
2015年02月03日 01点02分 5
level 11
width:30% 这存在问题~
2015年02月03日 03点02分 6
level 9
[吐舌]div里面不用p或者设置p{width:100%}试试
2015年02月03日 04点02分 7
level 1
给p设置属性p{display:block;width:30%}
2015年02月03日 05点02分 8
level 9
CSS强制换行啊
2015年02月03日 17点02分 9
level 9
word-wrap: break-word;加上这个,文字自动换行
2015年02月03日 17点02分 10
正解
2015年02月04日 05点02分
正解
2015年02月05日 03点02分
break all
2015年02月05日 03点02分
word-break:break-all;
2015年02月05日 03点02分
level 1
因为你输入的都是英文、而浏览器将英文默认为一个单位所以不换行、你换成中文就好了。
2015年02月03日 17点02分 11
可用此方法强制英文换行
2015年02月05日 03点02分
谢谢你
2015年02月05日 03点02分
level 9
https://developer.mozilla.org/en-US/docs/Web/CSS/word-break
- - - - - - - - - - - - - - - - - - - - -
Wenn du denkst,
Abenteuer seien gefährlich,
versuch's mal mit Routine.
Die ist tödlich.
2015年02月04日 05点02分 12
1