You need to apply a clear float on the parent div to make sure it occupies the inner elements. You can either insert <div style="clear:left;"></div> before closing the parent, or apply the clearfix class in the parent div.
.clearfix:after { content: "."; display: block; clear: both; visibility: hidden; line-height: 0; height: 0; } .clearfix { display: inline-block; } html[xmlns] .clearfix { display: block; } * html .clearfix { height: 1%; }β
Then you just add the clearfix class to the parent div
... <div class="question-template clearfix"> ...
Working example
source share