Look at this code:
#test {
width: 20%;
word-break: break-all;
}
<table>
<tr>
<td id="test">
<ul>
<li>HiByeHiByeHiByeHiByeHiByeHiByeHiByeHiByeHiByeHiByeHiByeHiBye</li>
</ul>
</td>
<td>
Box 2: Where is its 80% width?
</td>
</tr>
</table>
How do I set max width 20% for #test
with a super-long string non-broken in it? If I set width for the second td
, it wouldn't work!
===
Problem solved:
A line word-break: break-all
will simply work. Thanks for all your help!