CSS positioning: container always 60px off browser bottom, but scrollable -
i trying position large container div 60 pixels above browser bottom make room video stream , still images, similar this solution here.
unlike common sticky/fixed type footer, container kept in place on visiting page , subsequent browser resize - can scrolled users wanting explore site's content.
looking @ sample site, can see css property "top" changes on browser resize, can't find mechanism accomplishes this.
how should go achieving kind of elasticity?
thank in advance!
you can javascript along lines of
settop = function(e) { document.getelementbyid('content').style.margintop = window.innerheight - 60; }; window.onresize = settop;
full working example:
<html> <head> <title>my page</title> <style type="text/css" media="screen"> #content { width: 80%; margin: 0 auto; border: 1px solid black; height: 100%; } </style> </head> <body> <div id="content"> here content... </div> <script type="text/javascript" charset="utf-8"> settop = function(e) { document.getelementbyid('content').style.margintop = window.innerheight - 60; }; settop(); window.onresize = settop; </script> </body> </html>
Comments
Post a Comment