Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS - Background-size: Cover is too big

When i try to use the background-size:cover property with a fixed position my image becomes too big, and cropped. I'd like it to be the same size as the original image, but i can't figure this out. I'm trying to keep the affect of the image staying in position.

#wrapper {
  width:100%;
  height:580px;
   background-image:url('http://www.myorderdesk.com/Providers/206190/Files/31/full_width_image_1.jpg');
background-position: center center;
background-attachment:fixed;
background-repeat: no-repeat;
background-size: 100% 100%; 
/*background-size:cover;*/
-webkit-transition: background-image 0.4s;
-moz-transition: background-image 0.4s;
-ms-transition: background-image 0.4s;
-o-transition: background-image 0.4s;
transition: background-image 0.4s;
overflow: hidden;
-webkit-font-smoothing: subpixel-antialiased;
}

Here is my Demo

Full Screen Demo

like image 783
StinkyTofu Avatar asked Dec 22 '15 16:12

StinkyTofu


1 Answers

try this instead cover:

#wrapper {
background-size:contain;
}
like image 77
Prajwal Shrestha Avatar answered Sep 29 '22 14:09

Prajwal Shrestha