Click here to Skip to main content
15,886,518 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
How do I make the background image fit to the display in ASP.NET ? It must fit all other displays where it is running.
Posted
Updated 28-Apr-11 6:16am
v2
Comments
zohrehm 15-Dec-15 11:37am    
dd

You can only make a background image fit the browser window. You can do this with the css style

body
{
    background-img:url(myimage.jpg);
    background-size:cover;
}


If you google "css background image", you'll find a lot of other stuff about how to work with it.

EDIT =================

You can also do it with jquery:

http://srobbin.com/blog/jquery-plugins/jquery-backstretch/[^]
 
Share this answer
 
v3
Comments
Joan M 28-Apr-11 12:38pm    
Didn't know that!
I was thinking on using something like that soon...
Simple and direct answer! Niiiice! 5ed.
#realJSOP 28-Apr-11 14:24pm    
I updated my original answer with a link for a jquery technique if you can't do css3.
Joan M 28-Apr-11 16:11pm    
I can CSS so it is not needed but I'll check it, I don't want to get people without a shiny browser to not see the pages...

thank you again!
GenJerDan 28-Apr-11 12:48pm    
Looks like CSS3 only (IE9, FF4 etc). Dang...I could use it, too.
#realJSOP 28-Apr-11 14:23pm    
I updated my answer with a link for a jquery technique.
Not sure about your tag SQL2005. Here is a html tutorial about it. May be useful for you.
http://www.quackit.com/html/codes/html_stretch_background_image.cfm[^]
 
Share this answer
 

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