As you can see in the image below, my layout is a bit off. For some reason, when I don't have an img
tag within the bordered div
, it "floats" up. There's no css that seems to differ to make it do this. When inspecting it, it seems to not be missing anything or having anything extra that would make it do this.
Oddly, when I put in input
element inside of it, it then hangs down lower than the row of div
's with images. When I put in img
in it, it behaves correctly, sitting in line with the rest.
My html:
<div class="row">
<div class="col-md-12 center-block">
<div class="border background-choice">
<img src="background1.jpg">
</div>
<div class="border background-choice">
<img src="background1.jpg">
</div>
<div class="border background-choice">
<img src="background1.jpg">
</div>
</div>
<div class="col-md-12 center-block">
<div class="border background-choice">
<img src="background1.jpg">
</div>
<div class="border background-choice">
<img src="background1.jpg">
</div>
<div class="border background-choice">
</div>
</div>
</div>
My css(.scss):
#background-upload-modal {
.border {
border: solid 2px black;
}
.background-choice {
margin: 10px;
height: 150px;
width: 150px;
display: inline-block;
img {
height: 100%;
width: 100%;
}
}
}