[SOLVED] Set an image in div
Hi everyone
I have a problem I want put an image an a div
my css:
```css
.pic{
width: 300px;
height: 400px;
background-image: url('img/lol.jpg');
background-attachment: fixed;
background-position: center;
background-size: cover;
}
the result I have with cover

7 Replies
the result with contain

this what I m expected
can I have some idea to fix this problem ?

thanks
If you use
background-attachment: fixed;
you are fixing it to the body element and not the div. This is why it is being cropped so much.
Unless you need to attach it to the body for some reason, removing this should get you closer to what you want.thanks