Making a Background Image Stretch to its Parent Taghttp://forums.asp.net/t/1391460.aspx/1?Making+a+Background+Image+Stretch+to+its+Parent+TagMon, 30 Apr 2012 11:38:10 -040013914602975355http://forums.asp.net/p/1391460/2975355.aspx/1?Making+a+Background+Image+Stretch+to+its+Parent+TagMaking a Background Image Stretch to its Parent Tag <p>&nbsp;I've got some markup that looks like this:<br> </p> <pre class="prettyprint">&lt;asp:Panel runat=&quot;server&quot; HorizontalAlign=&quot;Center&quot;&gt; &lt;img alt=&quot;&quot; src=&quot;Background_Content.png&quot; style=&quot;width:90%;&quot; /&gt; Some Text &lt;/asp:Panel&gt;</pre> <p>I need to be able to have the text and the image tag overlap below the text like a background while also being able to &quot;stack&quot; more content below without messing with any absolute or relative positioning. The closest thing I could think of to describe this would be to use the CSS3 property background-size to stretch a background over the asp:Panel, but no browsers support CSS3. Is there any way to do this?<br> </p> <p>&nbsp;Thanks so much for your help!<br> <br> -Zane Kaminski<br> </p> 2009-03-02T02:06:57-05:002977338http://forums.asp.net/p/1391460/2977338.aspx/1?Re+Making+a+Background+Image+Stretch+to+its+Parent+TagRe: Making a Background Image Stretch to its Parent Tag <p>Anyone have any ideas? I'd really appreciate if someone could help. Thanks!<br> </p> 2009-03-02T17:52:38-05:002977476http://forums.asp.net/p/1391460/2977476.aspx/1?Re+Making+a+Background+Image+Stretch+to+its+Parent+TagRe: Making a Background Image Stretch to its Parent Tag <p>I don't quite understand what you mean, but is it something like this?</p> <p>&lt;div id=&quot;testDiv&quot; style=&quot;background-image:url(Images/YourImage.gif)&quot;&gt;<br> &nbsp;testDiv content<br> &lt;/div&gt;</p> <p>NC...<br> </p> 2009-03-02T18:51:55-05:002977883http://forums.asp.net/p/1391460/2977883.aspx/1?Re+Making+a+Background+Image+Stretch+to+its+Parent+TagRe: Making a Background Image Stretch to its Parent Tag <p>&nbsp;Yeah, pretty much. I just need to stretch the background image, and I don't think there's a way to do that with CSS2.1, so I have the image tag and I'm trying to fake a stretched background image. That's the difficult part.<br> </p> 2009-03-02T23:15:36-05:002979100http://forums.asp.net/p/1391460/2979100.aspx/1?Re+Making+a+Background+Image+Stretch+to+its+Parent+TagRe: Making a Background Image Stretch to its Parent Tag <p>The example that I posted stretches completely across the page, at least it did for me.</p> <p>NC...</p> <p>&nbsp;</p> 2009-03-03T11:13:25-05:002983027http://forums.asp.net/p/1391460/2983027.aspx/1?Re+Making+a+Background+Image+Stretch+to+its+Parent+TagRe: Making a Background Image Stretch to its Parent Tag It doesn't stretch on Firefox, Opera, or IE. All it does is make one image in the corner, or if you set tiling on, tiles the image, not actually stretches it. Regardless, I have decided to simply do away with the image because it was causing so much trouble, but thanks anyway. -Zane Kaminski 2009-03-04T20:17:37-05:003552218http://forums.asp.net/p/1391460/3552218.aspx/1?Re+Making+a+Background+Image+Stretch+to+its+Parent+TagRe: Making a Background Image Stretch to its Parent Tag <p>I have the same problem - with the background on a master page. &nbsp;Did you ever figure it out?</p> <p>thanks!</p> <p><br> </p> 2009-12-07T15:07:15-05:003552282http://forums.asp.net/p/1391460/3552282.aspx/1?Re+Making+a+Background+Image+Stretch+to+its+Parent+TagRe: Making a Background Image Stretch to its Parent Tag <p>until css 3.0 support, the best you can do is design the image to repeat (tile). or you could use javascript to get the size of the div, and have the server generate an image that size.</p> 2009-12-07T15:42:39-05:003564618http://forums.asp.net/p/1391460/3564618.aspx/1?Re+Making+a+Background+Image+Stretch+to+its+Parent+TagRe: Making a Background Image Stretch to its Parent Tag <p>Thanks for the prompt reply - I'm a novice with Java script, you wouldn't happen to have an example would you?</p> <p>thanks!</p> 2009-12-14T17:06:04-05:004958108http://forums.asp.net/p/1391460/4958108.aspx/1?Re+Making+a+Background+Image+Stretch+to+its+Parent+TagRe: Making a Background Image Stretch to its Parent Tag <pre lang="HTML" id="pre1"><span class="code-attribute">style</span><span class="code-keyword">=&quot;</span><span class="code-keyword">background-image: url(images.jpg); background-size:100% 100%;&quot;</span></pre> 2012-04-30T11:38:10-04:00