How to set background size (height & width)?
27,262
You want to use background-size: 100%
. Ensure that its browser support is compatible with your supported platforms.
$("#Stage").css({
"background-image": "url(BG.jpg)",
"background-attachment": "fixed",
"background-size": "100%"
});
Author by
Chris Lad
Updated on December 08, 2020Comments
-
Chris Lad over 3 years
I'm very new to JavaScript.
My code so far:
$("#Stage").css( "background-image", "url(BG.jpg)", "background-attachment", "fixed" );
What I want to do is have the background image at a set size so lets say:
width: 100%
andheight: 100%
.