javascript - mobile version of website doesn't fit horizontally -


i'm trying produce mobile version of website, have encountered 1 problem:

the whole website fits on computer (with example browser width of 480px) leaves space on right when viewing on mobile phone (regardless of browser used). whole site looks good, can scroll "out of website".

i first tried disable horizontally scrolling, included line:

<meta name="viewport" content="width=device-width; initial-scale = 1.0; maximum-scale=1.0; user-scalable=no" /> 

to disable (still scrollable!) space on right added "mobile.css": worked on computer, not on mobile.

body{ width: 100%; overflow-x: hidden; } 

i have tested website on following mobile browsers:

  • google chrome
  • dolphin
  • the default android browser

i wanted avoid javascript, if there javascript solution, please don't hesitate post it!

if want layout mobile friendly, it's best thinking right beginning. so, example, if going set fixed widths on elements (which don't recommend), such as—

#back-menu-left {with: 500px;} 

you need ask happen on small screen. so, either don't set width, or write @media rule override on smaller screens.

(i didn't check through rest of code, stopping when found 1 oversized element. best check , see if there other overwide elements that.)


Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

css - Firefox for ubuntu renders wrong colors -