html - Why is text within a fieldset appearing sometimes larger on mobile devices? -
this question has answer here:
- chrome on android resizes font 7 answers
i found strange chrome “feature” don't understand. when using fieldset
responsive design, text within fieldset appear bigger compared other contents of page.
when remove few characters text, takes same size other block on page.
for instance, following page generated chromium 49 using device mode. display similar on android smartphone running chrome. firefox in responsive design mode doesn't have glitch.
this the corresponding code. there no external css files.
<html> <head> <style> body{font-size:.8em;} </style> <body> <div> <p> lorem ipsum dolor sit amet, consectetur adipiscing elit. morbi porta sus cipit ultricies. sed velit quam, viverra eget accumsan dapibus, finibus eu lorem. vestibulum aliquam, neque sed ullamcorper tristique, arcu augue condimen tum orci, id vulputate nisl mauris non mas. </p> <fieldset> <p> lorem ipsum dolor sit amet, consectetur adipiscing elit. morbi porta suscipit ultricies. sed velit quam, viverra eget accumsan dapibus, finibus eu lorem. vestibulum aliquam, neque sed ullamcorper tristique, arcu augue cond imentum orci, id vulputate nisl mauris non mas. </p> </fieldset> <fieldset> <p> lorem ipsum dolor sit amet, consectetur adipiscing elit. morbi porta suscipit ultricies. sed velit quam, viverra eget accumsan dapibus, finibus eu lorem. vestibulum aliquam, neque sed ullamcorper tristique, arcu augue cond imentum orci, id vulputate nisl mauris non ma. </p> </fieldset> </div> </body> </html>
in piece of code, first <p>
of page , 1 inside first <fieldset>
contain same text. paragraph in second <fieldset>
contains 1 character less.
what happening?
note ugly workaround consists of specifying fieldset{font-size:.999em;}
in styles. makes 3 paragraphs appear similar. being said, i'm more interested origin of feature/glitch rather workaround/hack.
i discovered behavior design.
in order prevent chrome on android or chromium in device mode adjust font size depending on content of block, following meta element should added:
<meta name="viewport" content="width=device-width, initial-scale=1">
source: joe derose's answer similar question.
further reading: using viewport meta tag control layout on mobile browsers @ mdn.
Comments
Post a Comment