html - Use: Need Javascript code that gets the inner width/height of screen onload into width/height style variables -
i find innerwidth , innerheight of screen via javascript, , place values width , height variables of body class in style area (css) of html. example:
<style> body { background-image: url("images/hello.jpg"); background-repeat: no-repeat; background-color: brown; width: valuew; height: valueh;} </style> where valuew returned value of pixels of innerwidth of screen, , valueh innerheight. "px" pixels value need follow returned number of course.
is possible?
thanks input.
you're looking css vh , vw units, automatically.
no javascript needed.
Comments
Post a Comment