I can not get my div centered within a div. I’ve tried everything and I just can’t get it to work. The outer div is the “container” div, and the interior div is within another div entitled or classed as “background image”.
<!--Intro-->
<div class="container">
<!--Portfolio-->
<div class="background-image">
<div class="picture-row">
<div class="col-xs-4">
<img src='//cdck-file-uploads-global.s3.dualstack.us-west-2.amazonaws.com/freecodecamp/original/3X/5/0/50c0147bbe0ad7038df7d3d80e836cc95a8918bc.jpg' class="img-responsive" width="75%" />
</div>
<div class="col-xs-4">
<img src='//cdck-file-uploads-global.s3.dualstack.us-west-2.amazonaws.com/freecodecamp/original/3X/5/0/50c0147bbe0ad7038df7d3d80e836cc95a8918bc.jpg' class="img-responsive" width="75%"/>
</div>
<div class="col-xs-4">
<img src='//cdck-file-uploads-global.s3.dualstack.us-west-2.amazonaws.com/freecodecamp/original/3X/5/0/50c0147bbe0ad7038df7d3d80e836cc95a8918bc.jpg' class="img-responsive" width="75%" />
</div>
The weird thing is that the background image is centered within the “container” div, but the images within the “picture-row” div won’t center within the “container” div, as how the “background image” div does…
Here’s the CSS code for how I attempted to center the “picture-row” div:
.picture-row {
margin-left: auto;
margin-right: auto;
}
And here is the link to my code pen: https://codepen.io/IDCoder/pen/OWbXLw?editors=1100