Should I use Everywhere or just Fonts?

Asked

Viewed 75 times

5

I know to use in instead of px in sources for a good performance of its application in cell phones, but I only use it in font size. Shall I wear in also in places like margins, paddings, line-height, etc? Thank you

3 answers

3

I agree with @Ricardo Mota on this, I think you will end up more time making calculations than actually making a good site. In my practice for height, width use percentage to facilitate calculations and only use in fonts even, but before using them I usually leave them equivalent to 10px , also to facilitate in the calculation. I recommend if you have more questions about such practice of using EM to view this article http://clagnut.com/blog/348/ is in English but it helps a lot. Or that tableless article http://tableless.com.br/unidade-pixels-em-rem/ . Thanks

2

in is used in sources to help in responsiveness. If you are going to work with in be prepared to waste time with calculations.
Many sites standardize pixel font sizes like globe and Uol.
That tableless matter can help you http://tableless.com.br/unidade-pixels-em-rem/

1

WHAT IS IN?

1 MS was originally the size of the capital M letter of a given font. In CSS, 1 EM corresponds to the font-size value, which by default is 16px.

So starting from the general definition of EM, it is ideal for fonts. For other measurements, such as Divs size, etc, turn pixels into %.

How to do this?

objeto : contexto = resultado.

Example: A 264px column inside an 1128px wide div.

You take 264 and divide by 1128, which will give 0.23404255319149. Move comma two to the right and we have the percentage:23.404255319149%. Can use without rounding even for greater perfection.

Despite using more calculations, I believe that the result is much more satisfactory if you want a really responsive site.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.