Centering a Div within Div (I can't get My Div to Center)

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”.

<div class="container">

<div class="background-image">
<div class="picture-row">
      <div class="col-xs-4">
        <img src='//' class="img-responsive" width="75%" />
      <div class="col-xs-4">
        <img src='//' class="img-responsive" width="75%"/>
      <div class="col-xs-4">
        <img src='//' class="img-responsive" width="75%" />

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:

Try adding the center-block class to your images.

Would I put that in the CSS?

No. That class is part of Bootstrap :wink:

Haha never seen that term before! And what I’m trying to do is center that row of “Coming Soon” images between the border lines of the container…“center-block” will do that?

If I understood it correctly, what you want is to center the images in their respective divs/columns. Am I correct?

The “coming soon” image boxes are already centered within it’s own div, but it’s not centered within the main “container” div…for example, on the left side of the “coming soon” boxes, there is less of a space than there is on the right side of the “coming soon” boxes…that’s what I want to fix…

Try using CSS
position: relative;
margin: 0 auto ;

Actually, they weren’t.

I forked your pen and added red outlines to your columns.

I think the real problem is that the images are not centered. Giving them the center-block class should center them.

Hey! I FIXED IT! YAY! I had to add align=“center” to the “container” div! OMG! That was so easy!