html - How to align images across different divs horizontally -
can please me understand how align images horizontally across different divs in same row regardless of inner content of div? i've tried absolute positioning, i'm required interview test keep within inner div container.
example:
<div class="row"> <div class="col-md-3 product-box"> <div class="col-md-12 background-contain"> <p class="blue-title">product title 1</p> staring @ $500 <br> lorem ipsum dolor sit amet, consectetur adipiscing elit. <br> <div class="img-contain"> <img src="materials/images/cereal_b.jpg" class="img-responsive" alt="cereal" /> </div> <a class="bottom-link">learn more</a> </div> </div> <div class="col-md-3 product-box"> <div class="col-md-12 background-contain"> <p class="blue-title">product title 2</p> staring @ 1900 <br> donec ornare magna sit amet erat molestie sollicitudin ac vitae lectus.</br> <img src="materials/images/flower_b.jpg" class="img-responsive" alt="cereal" /> <a class="bottom-link">learn more</a> </div> </div> <div class="col-md-3 product-box"> <div class="col-md-12 background-contain"> <p class="blue-title">product title 3</p> staring @ 1900 <br> cras non metus sed odio tristique imperdiet.</br> <img src="materials/images/machine_b.jpg" class="img-responsive" alt="cereal" /> <a class="bottom-link">learn more</a> </div> </div> <div class="col-md-3 product-box"> <div class="col-md-12 background-contain"> <p class="blue-title">product title 4</p> staring @ 1900 <br> pellentesque mattis tellus ut molestie dapibus.</br> <img src="materials/images/candy_b.jpg" class="img-responsive" alt="cereal" /> <a class="bottom-link">learn more</a> </div> </div> </div> </div>
try use bootstrap class -"container-fluid". here jsfiddle: https://jsfiddle.net/z5v6t048/
<div class="container-fluid"> <div class="row"> <div class="col-sm-6 product-box"> <div class="col-md-12 background-contain"> <p class="blue-title">product title 1</p> staring @ $500 <br> lorem ipsum dolor sit amet, consectetur adipiscing elit. <br> <div class="img-contain"> <img src="materials/images/cereal_b.jpg" class="img-responsive" alt="cereal" /> </div> <a class="bottom-link">learn more</a> </div> </div> <div class="col-sm-6 product-box"> <div class="col-md-12 background-contain"> <p class="blue-title">product title 2</p> staring @ 1900 <br/> donec ornare magna sit amet erat molestie sollicitudin ac vitae lectus. <img src="materials/images/flower_b.jpg" class="img-responsive" alt="cereal" /> <a class="bottom-link">learn more</a> </div> </div> </div>
Comments
Post a Comment