css - Mobile Site ignores meta=viewport and is zooming-in any thumb or content -
it seems add meta work mobile version of site , ignored , full-zoomed ( when visit site on mobile ) actual size of have in css.
> tried : > <meta name="viewport" content="width=device-width,> initial-scale=1, maximum-scale=1"> & > <meta name="viewport"> content="width=device-width">
as matter of fact, took off line in hope not scale, still zoom-in !
the header, seems ok, , scaling on mobile , else, zoomed-in .
exemple : thumb 728x410 in css , yet , or without mobile meta viewport , still have same size on mobile makes huge!
also, when website loading on mobile, actual meta=viewport works , meaning if have set have 320 px on mobile, thumbs show should , when website loaded, bum .. 728px have in css!
anyone knows how fix this? thanks!
having built many responsive websites, have state if have content wider mobile screen (in case 320px, iphone only?), mess up. solve this, make sure have few main wrappers around content header
, content
, footer
div. give these divs following css rules when on mobile:
@media screen , (max-device-width: 480px) { .header,.content,.footer{ display:block; position: relative /*for absolute positioning or them behind pop-ups z-index prevents absolute-position elements being outside parent element stretching view*/ width:100%; overflow:hidden; } }
the above should prevent messing scaling. there, can see elements don't fit , style them accordingly.
also, if want disallow zooming, have put in user-scalable=0
, so:
<meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0' name='viewport' />
make sure content scales down phone's screen size. make major difference. recommend used using box-sizing:border-box;
. means adding padding or borders elements taken off element rather being added element.
example: screen 320px wide. have <div width="320"></div>
, 320px wide. adding padding:20px
it, make 360px
wide (20px
padding both sides)
however, using box-sizing:border-box
make sure stays @ 320px
(same 100% width) , instead, content fit within leftover 280px
. tip.
also: kind of media queries using in css file?
update website got this: --img removed privacy reasons --
these css changes i've made including adding meta tag in answer head, replacing yours:
#headercontent { width: 100%; height: 40px; margin: 0 auto; } #maincontainer { width: 100%; margin: 0 auto; } .videolistitem .thumb img { position: absolute; width: 100%!important; overflow: hidden; top: -68px; left: 0; } #leftcolumn { float: left; width: 100%; } .videolistitem .thumb .playicon { background: url(./images/play_icon.png) no-repeat 0 0; top: 50%; left: 50%; width: 86px; height: 60px; position: absolute; margin-top: -30px; margin-left: -43px; }
Comments
Post a Comment