Click here to Skip to main content
15,896,912 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
Posted
Updated 10-Jun-13 17:15pm
v2

1 solution

Use a
<img></img>
with
CSS
position:fixed;top:0;left:0;width:100%;height:100%;
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:
HTML
<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; */
}
 
Share this answer
 
Comments
Aravindba 7-Jun-13 6:16am    
no i cant use <img>,bcz inside td tag i have 4 to 5 controls ,if i use img that controls are goes down, i mean inside td tag i have html table for design and controls on that table,the whole table goes down not fit on the center of the td.
Ahmed Bensaid 7-Jun-13 6:26am    
Can we see a piece of code ?
Ahmed Bensaid 7-Jun-13 8:28am    
I sent you an email ;)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900