0

we have a div with a background image. We want to make the image smaller, not to exceed the parent div. Right now, because the image is too big, it comes out of the parent div. I tried max-width:100%;height:auto and display:block; like I saw in another thread but didnt worked. can someone help me? thank you in advanced

  • 2
    We need to see your HTML & CSS code but I think you should be looking at `background-size` for a **background-image**. – Paulie_D Jan 23 '15 at 12:11

1 Answers1

0
background-repeat:no-repeat;
-webkit-background-size:cover;
-moz-background-size:cover;
-o-background-size:cover;
background-size:cover;
background-position:center;

Copied from here.

Community
  • 1
  • 1
Isak
  • 365
  • 3
  • 11