0

Hi I have an image which should be background image I have written a div and inside div I maintained some style for it and its working fine in Chrome and mozilla firefox , but its not working in IE8+ versions. below is the div that I used in my html.Do someone please respond to this.

<div style= "background:url(../portal/images/AWI_logo.png) no-repeat; background-size:100% 100%;">

1 Answers1

0

You can use background-size: cover;

<h2>background-size: cover;</h2>
<div id="cover"></div>

div {
  width: 900px;
  height: 400px;
  border: 1px solid black;
  margin-bottom: 1em;
  background-image: url(img.jpg);
  background-repeat: no-repeat;
}

#cover { background-size: cover; }

see sample here you can learn more from csstricks here

Rahul
  • 4,294
  • 1
  • 10
  • 12