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

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -