scroll - CSS: How should I use `position` and other properties correctly to position my web page? -
scroll - CSS: How should I use `position` and other properties correctly to position my web page? -
i'm have functioning web page 3 parts. banner container, menu container, , content container
this layout:
the problem these positioned using position: fixed;
margin
, left
, , top
properties. means when web browser smaller size of web page, can't scroll on it. , yes. know solution remove "position: fixed" (which has been pointed out on other threads regarding topic here on stackoverflow). problem haven't been able detain layout while removing fixed position, not close.
the closest i've come changing position property of content container relative
. not impact layout while size of web browser window larger width of entire page, , when it's web browser window smaller content container can indeed scroll on it. of course, when decrease size of browser window content container follows , overshadows menu container (since still has fixed positioning). somehow menu buttons (which links placed in list), when not overshadowed content container, stops reacting when clicking on them , hovering on them.
so there rule of thumb on how supposed utilize positioning , other properties position web page, because have gotten wrong somehow.
these relevant css properties of 3 containers:
class="lang-css prettyprint-override">div#banner_container{ position: fixed; width: 650px; height: 75px; margin-left: 50px; margin-top: 8px; } div#menu_container { top: 95px; position: fixed; width: 150px; height: 150px; margin-left: 50px; margin-top: 10px; } ul#menu { position: fixed; left: 18px; top: 89px; } div#content_container { position: fixed; top: 95px; width: 100%; max-width: 492px; height: 500px; margin-left: 210px; margin-top: 10px; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; }
thanks in advance!
is ?
http://jsfiddle.net/0cmwhafq/2/
i set positions relative, , used float:left, menu , content container
div#banner_container{ position: relative; width: 99%; height: 75px; margin:1%; background-color:red; } div#menu_container { position: relative; width: 18%; margin:1%; height: 350px; background-color:green; float:left; } div#content_container { position: relative; width: 79%; height: 500px; margin-left:1%; margin-top:1%; float:left; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; background-color:blue; }
if want layout centered, add together wrapper containing of them
css scroll css-position
Comments
Post a Comment