如何为IE8拉伸td的背景图像? [英] How to stretch background image for td for IE8 ?

查看:49
本文介绍了如何为IE8拉伸td的背景图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hi
如何在ie8中拉伸td的背景图片,背景尺寸:100%100%;背景尺寸:封面;这些东西不支持ie8,所以请回复我如何在ie8中为td拉伸图像。



注意:不使用img bcz里面的td我有控件,如果我使用控件下降



Thanx

Aravind

Hi How stretch background image for td in ie8,background-size:100% 100%;background-size:cover; these thing are not support for ie8,so pls reply me how to stretch image for td in ie8.

Note:not use img bcz inside td i have controls,if i use that controls are goes down

Thanx
Aravind

推荐答案

使用
<img></img>



with

position:fixed;top:0;left:0;width:100%;height:100%;

和负z-index。很遗憾没有办法在IE 8中仅使用CSS实现此行为。



有关详细信息,请参阅以下文章:如何在网页中拉伸背景图片



如果您希望使用图像作为给定元素的背景,请尝试以下方法:

and negative z-index. There's unfortunately no way to implement this behavior in IE 8 using only CSS.

See the following article for further information: How Do you Stretch a Background Image in a Web Page.

If you wish to use an image as a background for a given element try the following approach:

<div class="fullbackground">
    <img class="fullbackground" src="yourImageSrc" />
</div>

.fullbackground{
    position:relative;
}
img.fullbackground{
    position:absolute;
    z-index:-1;
    top:0;
    left:0;
    width:100%; /* alternative: right:0; */
    height:100%; /* alternative: bottom:0; */
}


这篇关于如何为IE8拉伸td的背景图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆