A+ A-

Nonbreaking space entity in a html document

Suppose you want to use the phrase "Terminator 2: Judgment Day." Here, you would not want a browser to split the "Terminator, 2:, Judgment" and "Day" across two lines: 

In cases, where you do not want the client browser to break text, you should use a nonbreaking space entity   instead of a normal space. For example, when coding the "Terminator 2: Judgment Day" in a paragraph, you should use something similar to the following code:
 

Example :
 


<!DOCTYPE html>
<html>
<head>
<title>Nonbreaking Spaces Example</title>
</head>
<body>
<p>An example of this technique appears in the movie "Terminator&nbsp;2:&nbsp;Judgment&nbsp;Day."</p>
</body>

</html> 



This will produce the following result:  

An example of this technique appears in the movie "Terminator 2: Judgment Day."