css - Preventing horizontal scrolling in mobile devices -


i have long line @ top:

#top-line {   background: #00a1e0;   border-bottom: 1px solid #fff;   height: 4px;   position: absolute;   top: 0;   left: 0;   width: 10000px; } 

so i'm using overflow-x: hidden prevent horizontal scrolling:

html {   overflow-x: hidden;   height: 100%; } body {   background: #ededed;     font-size: 12px;     font-family: arial, sans-serif;     color: #666;   height: 100%;   overflow-x: hidden; } 

it works ok, in mobile phones still can scroll indefinitely right.

is there workaround this?

you should define width:100% or max-width:100% prevent horizontal scrolling because define width of area mobile device can occupy , nature occupying more width of mobile width define 100% restrict mobile width.


Comments

Popular posts from this blog

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -