html - Why the font is big for non responsive site? -
it's interesting me why font size big non-responsive site (with no <meta name="viewport" content="width=device-width, initial-scale=1.0">
tag) on small screens? want smaller , able zoom in.
html (just 2 columns text):
<div class="s"> <div> <h2>...</h2> <p>..</p> </div> <div> <h2>...</h2> <p>...</p> </div> </div>
css:
body { font: 100%/1.5 tahoma, geneva, sans-serif; } .s { display: flex; margin: 50px auto; width: 1000px; } .s div { background: #eee; flex: 1 1 100%; }
demo here https://jsfiddle.net/infous/3hjmc9o0/embedded/result/. can test f12,ctrl+shift+m (device mode) in chrome.
demo #2 https://jsfiddle.net/infous/3hjmc9o0/3/embedded/result/ text in <body> scalable want.
i'd text in red border above in image.
well, reason of effect because of "mobile text size adjustment" algorithms, details here https://drafts.csswg.org/css-size-adjust/. if don't use responsive mode, browser tries adjust text in paragraphs, headings etc.
theoretically, there's text-size-adjust
css rule control behaviour, does't work property in browsers.
fortunately, somebody found out hack/workaround:
p { max-height: 5000em; }
this max-height
disables "mobile text size adjustment" algorithms, think. , you'll paragraphs zoomed out, in example.
Comments
Post a Comment