I'm having trouble aligning elements to the center when applying margin: 0 auto. You can view the code here: https://jsfiddle.net/helloworld123/vhhx1o7n/
The goal is to align the elements in the center of the page (.entry-wrap should be centered) and have its children (.entry) floated to the left.
I've managed to achieve this to some extent in this fiddle https://jsfiddle.net/helloworld123/n8o18ges/, but I don't want the elements in the third row to be aligned to the center.
<div class="entry-wrap">
<div class="entry">
<img src="https://d13yacurqjgara.cloudfront.net/users/43342/screenshots/2772190/dribbble_2016_partb_001_teaser.jpg" alt="Shot title" />
</div>
<div class="entry">
<img src="https://d13yacurqjgara.cloudfront.net/users/43342/screenshots/2772190/dribbble_2016_partb_001_teaser.jpg" alt="Shot title" />
</div>
<div class="entry">
<img src="https://d13yacurqjgara.cloudfront.net/users/43342/screenshots/2772190/dribbble_2016_partb_001_teaser.jpg" alt="Shot title" />
</div>
<div class="entry">
<img src="https://d13yacurqjgara.cloudfront.net/users/43342/screenshots/2772190/dribbble_2016_partb_001_teaser.jpg" alt="Shot title" />
</div>
<div class="entry">
<img src="https://d13yacurqjgara.cloudfront.net/users/43342/screenshots/2772190/dribbble_2016_partb_001_teaser.jpg" alt="Shot title" />
</div>
</div>
body {
background: #f8f8f8;
}
.entry-wrap {
width: 500px;
height: auto;
margin: 0 auto;
background: #ccc;
padding: 10px;
}
.entry {
float: left;
border: 1px solid #f1f1f1;
margin: 2px;
}
This is the desired outcome that I am aiming for.