我可以发誓我看过有关此问题的文章,但我再也找不到它们了! 基本上如果我有
<div style="width: 250px;">The width of this div should be no less than 250px wide</div>
在下面的代码中,div
中的内容未将其宽度限制为指定的宽度,从而导致溢出问题:
<div class="PostIt">
<div id="tags"><span class="qExtraLarge"><a href="Team/Default.aspx#lucky">Lucky Khumalo</a></span>
<span class="qLarge"><a href="Investments/Social/School/Default.aspx">School</a></span>
a;orghaepoht8aegae[hgi'aehg[ahgiha[e8gjaerghuoaeir'ghu;dsOsgh;vrwi/jbvh?URbnIRWhb'a[985h[qygherionhbdl</div>
</div>
.PostIt { display: block; text-align: left; padding: 30px 30px 30px 30px; height: 240px !important; width: 190px !important; background: transparent url("Images/PostIt.png"); }
.PostIf #tags { width: 250px !important; }
任何建议都会很棒!
提前致谢。
最佳答案
如果您想隐藏任何溢出的内容,请使用overflow:hidden;
如果您想显示内容并仅强制换行,请使用 word-wrap:break-word;
关于css - div内容不受div宽度限制,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3577221/