Resizeable background image code debugging help
Below is the code i am using to make background image resiz开发者_运维知识库eable with the size of the DIV containing it. But it seems it is something wrong with the code.. Please someone help me.
.Ques // DIV
{
background:no-repeat url(https://mail.google.com/mail/help/images/greybtn.png) 0 0;
width: 400px;
height: 300px
}
.Ques.background-image
{
width: 100%;
position: absolute;
top: 0;
left: 0;
}
hmm try:
.Ques // DIV
{
background:no-repeat url(https://mail.google.com/mail/help/images/greybtn.png) 0 0;
background-size:auto;
width: 400px;
height:300px;
}
hopefully that should only stretch the image to its natural size or smaller, goodluck!
精彩评论