I want to place a div with a background of a photo in the middle of another div. I tried to use display: flex;
and align-items: center;
but it didn't work. I will use more divs like this one and if i use display: flex;
they will be placed one under the other one in a row from top to the bottom of the page.
HTML:
<div class="boxx">
<div class="box" style="background:
url('photos/acrilic/acrilic1.jpg') no-repeat center center ;
-webkit-background-size: contain;
-moz-background-size: contain;
-o-background-size: contain;
background-size: contain;">
</div></div>
CSS:
.boxx {
width: 350px;
height: 400px;
display: inline-block;
background: black;
}
.boxx .box {
margin: 0 auto;
width: 300px;
height: 300px;
}