I'm confident that there must be a straightforward solution to this issue, but I have yet to discover one without resorting to overriding the default behavior of Bootstrap - which doesn't strike me as an ideal approach.
Essentially, the problem can be boiled down to the following:
#main {
margin-top: 100px;
width: 100px;
background-color: black;
}
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<div class="container">
<div class="row">
<div id="main" class="col-lg-12 col-md-12 col-sm-12">
</div>
</div>
</div>
Even with no content present, you will still see a black stripe on the screen.
Upon closer examination, I realized that Bootstrap enforces the following default style:
// Prevent columns from collapsing when empty
min-height: 1px;
I've gone through resources such as Bootstrap min height and various other discussions on the matter, leading me to believe that this style is intentionally set.
However, in my scenario - like many others, I assume - where a search function triggers the display of a report beneath the search bar upon user selection, these stripes representing potential content areas are not desired until data populates them.
While I can brainstorm some JavaScript workarounds, I am curious if achieving this solely through CSS is possible. Modifying the min-height
value to 0 is always an option, but perhaps there's a recognized method for suppressing the display of color-filled stripes in empty content areas by avoiding overrides.