How and when to use dip pixels? They write that you need to specify dp or dip directly in the code instead of px . but when I write in a CSS declaration, for example, width:100dp; or width:100dip; , it gives an error.

  • one
    There is no such unit. Perhaps they wanted to do it, but now px are just abstract units that are not related to the physical resolution of the screen. - Alexey Ten

1 answer 1

It would be interesting to look at a book or tutorial in which they write like that.

In CSS there is no, and there will not be, dp and dip units. The conventions in CSS are such that the use of px completely ensures pixel-independent devices.

I wrote about this in detail in the questions:

  • one
    css-live.ru/articles / ... apparently the author of the question is confused. dp is somewhere in android - Alexey Ten
  • I am completely confused in these pixels. there are several types of them, and it is not clear which type is meant in a particular case. if this is a CSS declaration, then CSS pixels are meant. only this is clear to me at the moment. it is not clear in what cases the pixels of iron are meant (physical pixels). it is not clear in what cases dip pixels are meant - Dimon
  • is there a chat to discuss a question without using comments? - Dimon