html - Viewport width stopping fixed div from scrolling horizontally -


i making mobile webpage height of mobile screen scrolls horizontally through content.

the problem running div fixed position scroll horizontally until reaches viewport width (i have been testing in chrome device mode enabled , iphone 6 selected, has viewport width of 375px while body element has width of 1875px).

here code showing simplified version of problem:

<!doctype html> <html>     <head>         <meta name="viewport" content="width=1875, height=device-height, initial-scale=1">         <style>             body{                 width: 1875px;                 margin: 0px;             }             div{                 width: 200px;                 position: fixed;                 border: 1px solid black;             }         </style>     </head>     <body>         <div>             <p>this test paragraph</p>         </div>     </body> </html> 

i have found similar questions, people asking how stop fixed div scrolling horizontally, whereas want fixed div scroll entire width of body element without stopping @ viewport width.

i put fiddle cannot replicate problem without device simulation in chrome dev tools.


Comments