My question is how can I show a block div
without it having any content, no text or anything. I'm trying to make an html layout but I don't want to include any content.
My question is how can I show a block div
without it having any content, no text or anything. I'm trying to make an html layout but I don't want to include any content.
Greetings, the reference of the code that I attach is merely as an example since it totally depends on the construction of your website:
Both the width and height properties are added, since a div is an element that by default needs content that gives it dimensions, so if I remove these measurements, it loses proportion and the browser's rendering engine does not know what dimensions to give it.
The styles are merely optional to have them directly in the HTML you could put them in a separate css and link it to the HTML
You just need to specify the background-color, width and height
.hello{ Width: 100%; Height: 150px; background-color: gray; }