它仍然溢出它看起来像这样
<table id="hlavni" style=" position:absolute; border:none; position:relative; background-color:#FFC; border:#999 1px solid;" cellpadding="5">
<tr>
<td id="yamana" class="trida" valign="top" style="line-height:1.5em;"><div style="background-color:#FFC;" id=load_tweets>44444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444</div>
</td>
</tr></table><br />
<html>
<head>
<style type="text/css">
#limit {
max-width: 500px;
}
</style>
</head>
<body>
<div id="limit">Your content goes here</div>
</body>
</html>
max-width和width -both-如果文本不包含问题中的示例中的任何空格,则不会阻止溢出。
div {
max-width : 300px;
word-wrap: break-word;
}
看到这个fiddle的解决方案。
对于这种情况,div必须具有样式“word-wrap: break-word”才能工作。