How can I break long words instead of overflowing?
How can I stop this text due to overflow?
<html> <head> <style type="text/css"> .sticky { background-color: #FCFC80; margin: 5px; height: 100px; width: 135px; } .sticky .edit { vertical-align:middle; height: 100px; position:relative; color:Black; background-color:blue; height:90px; vertical-align:middle; width:90px; border-collapse:collapse; } </style> </head> <body> <div id="note44" class="sticky"> <div id="text44" class="edit" title="Click to edit" style="">A very long word: abcdefasdfasfasd</div> </div> </body> </html> The above css will not work in all browsers as it is non-standard. When I come across this, I usually use the php wordwrap function, but that is not good if you are not using php.
Two things to indicate: You have determined the height of the second element twice in css. If you wrap text inside an element with a certain height, it can become very full and cause a new set of problems.