Nonbreaking space in HTML

Sometimes, you don't want the browser to separate consecutive words to the new line. So nonbreaking   space comes to the picture.

These are the words which will never be separated: "The Three Kings"

These are the words which will be separated at sometime when you make the winow smaller: "The Four Kings"


<!DOCTYPE html>
<html>
    <head>
    </head>
    <body>
        <p>
            These are the words which will never be separated: "The&nbsp;Three&nbsp;Kings"
        </p>
        <p>
            These are the words which will be separated at sometime when you make the winow smaller: "The Four Kings"
        </p>
    </body>
</html>
                        

&nbsp; adds a space but this space is non-breaking.

Conclusion

So, in this section, you learned about &nbsp.
In next section, you will learn about bold, italic and underlined text in HTML.