Back

Text size

What is text size ?

Text size is the space that characters occupy in the content of a WEB page. The size of a text is defined in the CSS styles thanks to the "font-size" property. By default, in the absence of instructions, browsers generally use a size of 16px.

body {
    font-size: 14px;
}

The value that the attribute "font-size" can take is expressed in pixels (px), it can also be expressed through other units (%, em, rem) which are translated into pixels by the browser.

Why is it important ?

If the text size is not big enough, especially on cell phones, users will have difficulty reading the content of your page and will have to zoom in to make it accessible. Having to manipulate the browser to make the content accessible degrades the user experience, so it is essential to provide the best accessibility to users from the first display of the WEB page.

How can it be optimized ?

To provide an optimal experience, at least 60% of the text must be larger than 12px. If this is not the case it is necessary to :

  • increase the values of the "font-size" property of the concerned elements in the CSS styles
p { 
    font-size: 8px; 
    font-size: 14px;
}
  • specify a "meta viewport" for the mobile version in the HTML code, so that the browser can adjust the size of the text
<head>
    ...
    <meta name="viewport" content="width=device-width, initial-scale=1">
    ...
</head>