我有一个页面,内容如下......
<div id="content">
testingtestingtestingtestingtestingtestingtestingtestingtesting
testingtestingtestingtestingtestingtestingtestingtesting
testingtestingtestingtestingtesting
</div>
我如何对其应用最大宽度。我在 css 中使用这段代码
#content {
max-width:50px; /* for standards-compliant browsers */
/*width:expression(document.body.clientwidth > 650? "650px": "auto" );*/
/* max-width expression for IE only */
}
但我在 Firefox 中没有得到结果......http://pradyut.dyndns.org/WebApplicationSecurity/width.jsp http://pradyut.dyndns.org/WebApplicationSecurity/width.jsp
有没有 JavaScript 解决方案?
任何帮助
thanks
Pradyut
那么,您在链接提供的页面上没有获得预期结果的原因是您正在使用span
代替div
.
Add
display: block;
适合你的风格。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)