Website elements and fonts are too small in mobile devices

HtmlCssResponsive Design

Html Problem Overview


I have just finished designing and coding my new project. But I need it to work well in mobiles. I resized my screen to something like 350~400px width and started coding and adding some media-queries to it. Looks great in redimensioned browsers. I have cut some elements and features and everything was fine... until I tested it with my smartphone

The screen isn't big. Less than 4' (probably 3.5). I put some alerts in the code and realised its width was 980px. Almost 3 times bigger than my tests on resized browsers.

Everything is just too small. Other things are great: media queries are working, the cuts I made in the code are OK too, but you can barely see the content in my mobile. This is certainly not I wanted.

I want it to look like an App and indeed it looks like an app on the redimensioned browser.

How do you create your responsive websites to deal with problems like this one?

I read something about using EM (and there is something new called REM) units but I am still very confused about it. Do I have to change ALL the px to em?

And also I know you can set the font-size in the html or body tags and all the other elements will inherit from them. Is that an approach? What do you usually do? Is there a trick or something? I'm not using bootstrap nor any other front-end framework.

Html Solutions


Solution 1 - Html

You can try adding the viewport <meta> tag :

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

Solution 2 - Html

Use media queries (Link) and percentages (%), 16px (default font size) = 100%. I hope it helps.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionVictor FerreiraView Question on Stackoverflow
Solution 1 - HtmlSpockView Answer on Stackoverflow
Solution 2 - Htmluser3187075View Answer on Stackoverflow