L
L
l_stl_st2018-04-26 06:12:35
css
l_stl_st, 2018-04-26 06:12:35

In what units and in general how to set font sizes and indents so that it works optimally in older browsers?

In new browsers, you can set everything to vw and it will be fine. Or in rem, and in media-queries change the font size .
But what if I want my layout not to move around when I open it, for example, on iphone 4.
The version of Safari in it does not support vw and rem. You can't bind dimensions to either the window width or the root element's font size.
What method can be used? How to set the main sizes and sizes for media-queries so that it is adaptive?
https://codepen.io/as-tall/pen/xjEGgB

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey delphinpro, 2018-04-26
@l_stl_st

.selector {
  font-size: 16px; /* fallback */
  font-size: 1rem;
}

Of course, you should write a mixinchik for the preprocessor, which will recalculate into pixels / rhemes / viewports. Or a plugin for post-css.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question