Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Font size extremely small on mobile devices

Tags:

I have a <p> block in a huge <div> in the main body of my html with 80% in font-size, and also I have a footer <div> in the lower part of my body.

The text in the footer has also 80% font-size, and if I test it on my PC it is equal, but if I test it in a mobile device, the text of the footer is extremely small, impossible to be read.

How is this possible? Which is the explanation and how can this be avoided?

My main text:

<div id="mainTextContainer" class="text">
    <p>test text</p>
</div>

My footer:

<div id="cookiesBar">
    <div>
        Esta web utiliza 'cookies' para su navegación.
        Al utilizar nuestros servicios aceptas su uso.         
    </div>
</div>
    

My CSS:

#cookiesBar {
    display: none;
    position: fixed;
    left: 0px;
    right: 0px;
    bottom: 0px;
    width: 100%;
    text-align: center;
    height: auto;
    background-color: rgba(136, 188, 182, 0.7);
    z-index: 99999;
    border-radius: 0px;
    text-decoration: none;
    line-height: 30px;
    font-size: 80%;
    font-family: verdana;
}

#mainTextContainer {
    width: 80%;
    margin: auto;
    text-align: center;
    margin-top: 60px;
}

.text {
    font-size: 80%;
}
like image 471
NullPointerException Avatar asked Feb 22 '16 21:02

NullPointerException


People also ask

Why is my font size so small?

Why is my font so small? Hold down the Ctrl key on your keyboard, and press the plus (+) key or the minus (-) key to make the on-screen text larger or smaller. Here's a guide on more ways to increase the font size. How do I increase the size of my screen?

What font size is too small for mobile?

Size # In general, the rule of thumb is that font size needs to be 16 pixels for mobile websites. Anything smaller than that could compromise readability for visually impaired readers. Anything too much larger could also make reading more difficult.

What is the normal font size in mobile?

The ideal base font size for mobile screens is 16 pixels. Anything smaller and users will have to pinch and zoom to read. In your site's CSS, it's recommended to set the font-size attribute in "ems" to make it more easily scaled. Using ems is helpful because it changes text relative to the size set in the document.

What is the smallest readable font size for Android?

Your minimum font size should be 12 pixels; anything smaller and users will be squinting. Be sure to choose a typeface that is clean and easy to read. If possible, avoid use of image-based text.


2 Answers

Have you added the viewport meta tag to your document?

If not, add this to your head section:

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

A mobile browser will naturally attempt to zoom out to display your entire web page like a desktop browser. The viewport meta tag scales your page to the device width.

More information:

  • A tale of two viewports ~ QuirksMode.org
  • Using the viewport meta tag to control layout on mobile browsers ~ MDN
like image 119
Michael Benjamin Avatar answered Nov 07 '22 20:11

Michael Benjamin


Depending on the version of IOS you're using it may actually be an issue, with that version of the browser.

Just declare the base font size:

body {
 ~mybase font size
}
like image 37
Sean Avatar answered Nov 07 '22 19:11

Sean