html - Why does my mobile device still treat my viewport as a desktop? -


i doing quick mobile version of desktop site in bootstrap , running formatting issues. when expand view on desktop, icons show in 3 4 grid fine. when narrow width of window, grid of images acts accordingly , narrows down 1 column 12 images per row, no horizontal side bar.

however, when viewing on mobile, my nav bar not 'snap' width of visible resolution per , allows me side scroll - though images still aligned in 1 column of 12 images. navigation acts if being viewed on desktop , not on mobile despite site detecting being viewed on mobile. might hard replicated in fiddle without seeing on mobile, included fiddle see if can tell talking about.

/*******general********/

*{   box-sizing: border-box;   margin: 0;   zoom: 1;    font-size: 13px; }  body{     background: #f9f9f9 url(../img/crossword.png) repeat top left;     font-family: 'open sans', tahoma, sans-serif;     max-width: 100%;     background-color: #5f5e5e;     font-size: 13px;     color: #333;     overflow-x:hidden; } 

sorry had include code in post include fiddle, entire index , css there. added show hide x overflow in hopes rid mobile x-scrolling did desktop x-scrolling.

fiddle here:

http://jsfiddle.net/09wfonqv/5/

again, looks fine on desktop - when opened in mobile, demo allows horizontal scrolling throughout , doesn't show images in single column dropdown menu visible in display like.

thanks!

you haven't set viewport in head. - that's critical error!

add <meta name="viewport" content="width=device-width, initial-scale=1"> head.

you need media queries.

add @media screen , (max-width:480px) {your styles} , same 768px css. (ipad) start there.


Comments

Popular posts from this blog

python - pip install -U PySide error -

arrays - C++ error: a brace-enclosed initializer is not allowed here before ‘{’ token -

cytoscape.js - How to add nodes to Dagre layout with Cytoscape -