Wrap to break word - HTML CSS CSS Property

HTML CSS examples for CSS Property:word-wrap

Description

Wrap to break word

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <style>
#foo {<!--from ww  w. j  a  v  a2 s. c o  m-->
   width:100px;
   background:gold;
   word-wrap:break-word;
   margin-bottom:51px;
}

#bar {
   width:100px;
   background:gold;
   word-wrap:normal;
}
</style> 
 </head> 
 <body> 
  <div id="foo">
    This text is too long to fit in the div. but it wraps to new lines anyway! 
  </div> 
  <div id="bar">
    This text is too long to fit in the div. but it DOESN'T wrap to new line! :( 
  </div>  
 </body>
</html>

Related Tutorials