Sometimes, we want to make a div with no content have a width with HTML.
In this article, we’ll look at how to make a div with no content have a width with HTML.
How to make a div with no content have a width with HTML?
To make a div with no content have a width with HTML, we add a non-breaking space in the div.
For instance, we write
<div> </div>
to add a div with the
non-breaking space to make the div have a width.
Conclusion
To make a div with no content have a width with HTML, we add a non-breaking space in the div.