1
I have a simple div:
<div class="quadrant">
<h1>X</h1>
</div>
//CSS
.quadrant {
background-color: #E7E7E7;
margin: auto;
height: 40%;
width: 20%;
}
When I have some element within that div, as in the case above (an H1 with an X) it appears normally
But when I take the X (which will be the pattern of what I’m doing) it just goes away.
I wish when loading the page, it would appear even if it had no content, because its content will be added later by the user.
Thank you very much Sam. She is inside a . Row which in turn is inside a . Bootstrap container.
– Naldson
So neither class . Row nor . container has declared heights. Thus the 40% height of the div is without having to base.
– Sam
Is there any way to make the div appear normally without me changing the Row result? Example, do not touch the positioning or size I have of it currently.
– Naldson
Put a
min-height
in pixels, a minimum size that the div may have. Ex.min-height: 100px;
– Sam