Word Breaks

The word-wrap property tells the browser how to wrap a work. The allowed values for this property are described in the following table:

ValueDescription
normalWords are not broken
break-wordWords are broken to make them fit.
 
<!DOCTYPE HTML> 
<html> 
    <head> 
        <title>Example</title> 
        <style> 
            p { 
                width:150px; 
                margin: 15px; 
                padding: 5px; 
                border: medium double black; 
                background-color: lightgrey; 
                float:left; 
            } 
            #first { 
                word-wrap: break-word; 
            } 
            #second { 
                word-wrap: normal; 
            } 
        </style> 
    </head> 
    <body> 
        <p id="first"> 
            HyperText Markup Language (HTML) is the main markup language for 
            displaying web pages and other information that can be displayed 
            in a web browser(From From Wikipedia, the free encyclopedia).
        </p> 
        <p id="second"> 
            HyperText Markup Language (HTML) is the main markup language for 
            displaying web pages and other information that can be displayed 
            in a web browser(From From Wikipedia, the free encyclopedia).
        </p> 
    </body> 
</html>
  
Click to view the demo
Home 
  HTML CSS Book 
    CSS  

Related: