+ 6
When i use {position:fixed} and scroll it moves a bit upward and then the attribute works ?
eg. - I made a div element and I put the the position to fixed , div { position:fixed; width:100%; height:10%; top:0%; left:0%; } when I scroll downward it moves a bit upward and then the fixed attribute works . How to prevent that from happening?
4 Respuestas
+ 12
Put your whole page except the fixed tag inside a <div> and make it fullscreen. This way the user will scroll the <div> and not the whole page.......
+ 13
try above and :
html, body {
overflow:hidden;
}
+ 5
@valentin it acted really weird when i put the width of the div (covering everything) below 90% it worked else the same condition
+ 5
sorry my mistake, I put one elements width to 100%
with additional padding ,
now it works thanks