E
E
eugenedrvnk2020-05-15 11:37:07
css
eugenedrvnk, 2020-05-15 11:37:07

What are the units for offsets?

In this example, the icon (to the left of the text) is absolutely positioned in pixels. And somehow my brain suddenly began to break down that probably in this situation it would be correct to use rem. Is it so? Considering that this icon is a component of a block with text - in theory, its size, indents, etc. should line up depending on the size of the text? Or would it be better to do it as a percentage?

rJQrbDE.png

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Ankhena, 2020-05-15
@eugenedrvnk

Everything is just outrageous.
If this indent should change when the font size of the root element changes, then in rem.
If it depends on the current font, then em.
If it does not depend on anything and is always constant, then in px.

T
Type Programmer, 2020-05-15
@Oleg2002pr

Well, as for me, what's the difference. The main thing is the result

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question