html - long data extending the limit of div -


i having problem keeping long data within divs boundary.

here demo facing problem:

<html> <head>     <style>         #main {           width: 500px;           margin:50px auto;         }          #data {           width:500px;           height:500px;           border: 1px solid #000000;         }     </style> </head> <body>     <div id="main">         <div id="data"> testtesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttest         </div>     </div> </body> 

here make div width 500px fix still data extending div boundary.

is there solution when data reaches max width remaining data displayed in next line?

you can use word-wrap:break-word; if you'd text keep inside div , appear on next line.

jsfiddle here.


Comments

Popular posts from this blog

Perl - how to grep a block of text from a file -

delphi - How to remove all the grips on a coolbar if I have several coolbands? -

javascript - Animating array of divs; only the final element is modified -