How to make a grid of images with padding in HTML and CSS -
i trying make grid 2 pictures in height , 3 pictures in length inside of section div. this optimal solution. underneath picture descriptive text limited width of single image. these images , text have padding each other. here jsfiddle. https://jsfiddle.net/278sem83/
css
body{ margin:0; padding:0; } #header { background-color:#ff6600; color:white; text-align:left; padding:2px; } #nav { line-height:30px; background-color:#fff000; height:350px; width:125px; float:left; padding:5px; } #section { width:350px; float:left; padding:10px; } #footer { background-color:#737373; color:white; clear:both; text-align:center; } #container { margin:auto; width:900px; text-align:left; overflow: hidden; } .inner_block { display: inline-block; text-align: center; width: 350px; height:200px; } img { width: 350px; } .main_block{ text-align:center; width:750px; }
html
<div id="container"><!---container---> <div id="header"> <h1>jordas</h1> </div><!--header--> <div id="nav"> <a href="index.html">etusivu</a> <br> <a href="teltat.html">teltat</a><br> <a href="page2.html">palvelut</a><br> <a href="yhteystiedot.html">yhteistiedot</a><br> </div> <div id="section"> <div class="main_block"> <p> tervetuloa jordas ab:n kotisivuille. olemme... </div><!--mainblock--> </div> <div id="footer"> <h3>pop-up telttojen ykkÖnen </h3> </div><!--footer--> </div> <!--container-->
here code started layout wanted:
<div class="main_block"> <div class="box">box</div> <div class="box">box</div> <div class="box">box</div> <div class="box">box</div> <div class="box">box</div> <div class="box">box</div> </div><!--mainblock-->
css:
.box { float: left; width: 29%; height: 75px; margin: 10px; border: 3px solid blue; }
working fiddle: https://jsfiddle.net/nfeltafz/
Comments
Post a Comment