开发者

Stretch an image in a div background

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

My CSS is lik开发者_运维问答e 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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜