Responsive image, does not resize correctly

1
I'm developing a site , and an image is not resizing as I expected, I have the image:

<div class="cover">
    <div class="cover-image" style="background-image : url('http://4.bp.blogspot.com/-AycDlsjqzZg/TwNAOJgtvWI/AAAAAAAAAsU/7J9HDoXhHLs/s1600/bouken-ni+logo+01.png')"></div>
</div>

And I have my CSS class to resize:

.cover {
 padding: 30px 15px;
 margin-bottom: 30px;
 color: inherit;
 background-color: #eeeeee;
 margin-bottom: 0px !important;
 padding: 0px 0px;
 background-color: transparent;
 display: -webkit-box;
 display: -ms-flexbox;
 display: -webkit-flex;
 display: flex;
-webkit-align-items: center;
 align-items: center;
 overflow: hidden;
 position: relative;
 height: 70%;
}
.cover .cover-image {    
z-index: -1;
position: absolute;
top: 0px;
width: 100%;
min-height: 30%;
height: 100%;
background-size: cover;
background-position: center;

}
    
asked by anonymous 26.06.2015 / 05:55

1 answer

1

The following André is the background-size when you pass some unit of measure in% for example it does the resizing while keeping the aspect ratio of the image based on the width and height of the parent box. Now if you use the keyword (contain / cover) it resizes proportionately but working differently. Contain: Largest dimension occupies the entire extension of the box; Cover: Smallest dimension takes up the whole extension of the box.

Now you choose the best friend layout.

    
11.07.2015 / 10:59