educative.io

Why we are giving width:80px on smaller devices and width:320px on larger devices?

why we are giving width:80 on smaller devices and width:320px on larger devices? Instead we can give width:30% and it automatically handles both the situation of smaller and larger devices or is there is any other difference between the two ?

We are mentioning width based on small/large devices. If we write only 30% width then it will change the width size to 30% whenever we minimize or maximize the screen.

So what’s the difference between both the approach. I used both, did not see any difference.
is there is any other difference that we can say one is better than the other?