0

I have a div with a background image - and I want it to stretch as the div itself stretches.

My CSS is like this:

.infobox-medium-text
{
    width: 473px;
    height: 208px;
    background: url(../../images/infobox/infobox-medium.png) top no-repeat;
    float:left;
}

where as a div receives the .infobox-medium-text class.

Thanks.

Gaurang Tandon
  • 6,504
  • 11
  • 47
  • 84
Roman
  • 4,443
  • 14
  • 56
  • 81

1 Answers1

1

Have a look here: Stretch and scale a CSS image in the background - with CSS only

EDIT: If you want this technique to work on a div instead of the body, add position: relative; to the div's css.

Community
  • 1
  • 1
Spiny Norman
  • 8,277
  • 1
  • 30
  • 55