csscoder21 Posted August 13, 2010 Share Posted August 13, 2010 How can I prevent this? <div id="NCCID_1" style="clear: left; margin-bottom: 3px;"> <div style="margin-right: 5px; min-height: 64px; background-color: #222222; font-size: 10px; color: #FFFFFF; word-wrap: break-word;"> <img src="test.jpg" style="float: left;"> <div style="background-color: #2E302E;"> <table cellspacing="0" cellpadding="0" style="font-size: 12px;"> <tr> <td style="width: 182px; text-align: left; padding-left: 2px;"> <span style="color: #FF0000;">test</span> <span style="color: #FFFFFF;"> - </span> <span style="color: #FE4D1B;">2:21 pm</span> </td> <td style="width: 180px; text-align: right; padding-right: 2px;"> <img style="vertical-align: -1px;" title="Delete" src="images/x.png" onClick="DELETE_NEWS(1);"> </td> </tr> </table> </div> blah blah blah </div> </div> Using Doc Type HTML 4.01 Strict Link to comment https://forums.phpfreaks.com/topic/210673-text-dropping/ Share on other sites More sharing options...
AtlasC1 Posted August 13, 2010 Share Posted August 13, 2010 Instead of outputting the string directly you could use something like wordwrap(). i.e., wordwrap($string, 88, "<br />\n", true) Is that what you're looking for? -jm Link to comment https://forums.phpfreaks.com/topic/210673-text-dropping/#findComment-1099031 Share on other sites More sharing options...
csscoder21 Posted August 13, 2010 Author Share Posted August 13, 2010 Thanks for the reply, but my problem is the word-wrap: break-word; property works fine, except if it breaks a word it drops it below the rest of the content on its line.... like the image in this example... Link to comment https://forums.phpfreaks.com/topic/210673-text-dropping/#findComment-1099033 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.