How can I set the background image to fit the exact size of the browser's window. I am familiar with JavaScript/HTML/CSS/JQuery so any language will work for me.
-
3Check out this css-tricks.com/perfect-full-page-background-imageNelson Benítez León– Nelson Benítez León2012-10-12 18:32:22 +00:00Commented Oct 12, 2012 at 18:32
-
Possible duplicate of CSS background image to fit width, height should auto-scale in proportionAlex Angas– Alex Angas2016-03-01 00:56:57 +00:00Commented Mar 1, 2016 at 0:56
Add a comment
|
4 Answers
Thanks to @Nelson 's comment I have found my answer here: http://css-tricks.com/perfect-full-page-background-image/
Comments
I've used the Backstretch jQuery plugin for this before.
Comments
Try this:
<img src="images/BG.jpg"
style="width:100%;height:100%;position:absolute;top:0;left:0;z-index:-5000;">
http://thewebthought.blogspot.com/2010/10/css-making-background-image-fit-any.html