容器内的文本换行后的自动宽度_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 12:11:26
Original
926 people have browsed it

最近遇到一个这样的问题,
在一个限制max-width的容器内,当内部文本不够长时,容器的宽度能自动适应,但当文本长到换行时,容器的宽度则不能自动适应。
有没有朋友能帮忙看一下这么问题,要求是,最要不要动现在的样式,因为这些样式是公用的,最后是写些覆盖的样式。谢谢。附上提取的代码,方便大家直接调试的。

IE上看不到这个问题,Firefox等标准浏览器能看到这个问题。




Copy after login


回复讨论(解决方案)

我在IE和firefox下试了试,结果相同

第一次遇到这个问题,
我觉得是这样的,
如果超过了max-width,那么容器的width就是 max-width所定义的宽度了,所以就不能自动适应了。


大家来讨论下。

IE与Firefox下的结果是不同的,IE8以下因为不识别max-width,所以再长的文本都只会一行显示出来,不会分行。

真没有办法吗?

支撑一下。。。

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!