---
title: "Comment by Prateek Aher on \"🛑 Stop using pixels in CSS\" | Hashnode"
description: "I don&#39;t understand. If rem is directly proportional to px , what advantage does it possibly hold? I&#39;ve been using px only for borders and %, vw &amp; vh"
url: "https://hashnode.com/posts/stop-using-pixels-in-css/5f5c5f0eddc3fe5f4f24cbbb/comment/5f5c7b77ddc3fe5f4f24ccda"
---

[Discussion](https://hashnode.com/posts/stop-using-pixels-in-css/5f5c5f0eddc3fe5f4f24cbbb)

Comment [🛑 Stop using pixels in CSS](https://hashnode.com/posts/stop-using-pixels-in-css/5f5c5f0eddc3fe5f4f24cbbb)

[Prateek Aher](https://hashnode.com/@prateek_aher)

[Sep 12, 2020](https://hashnode.com/posts/stop-using-pixels-in-css/5f5c5f0eddc3fe5f4f24cbbb/comment/5f5c7b77ddc3fe5f4f24ccda)

I don't understand. If _rem_ is directly proportional to _px_, what advantage does it possibly hold? I've been using _px_ only for borders and _%, vw & vh_ for the rest.

[Chris Bongers](https://hashnode.com/@dailydevtips)

[Sep 12, 2020](https://hashnode.com/posts/stop-using-pixels-in-css/5f5c5f0eddc3fe5f4f24cbbb/comment/5f5c7b77ddc3fe5f4f24ccda#reply-5f5cc33dddc3fe5f4f24d08a)

Good question [Prateek Aher](https://hashnode.com/@prateek_aher) it comes down to accessibility.

So if you set your browser default to be 20px because of your bad eyes or whatever reason. rem is a way better solution, then us defining what would be best for you.

For borders and media queries however it is still a valid point of using px.

Also can't live without vw and vh :D

[Peter Thaleikis](https://hashnode.com/@spekulatius)

[Sep 12, 2020](https://hashnode.com/posts/stop-using-pixels-in-css/5f5c5f0eddc3fe5f4f24cbbb/comment/5f5c7b77ddc3fe5f4f24ccda#reply-5f5cca8813599a5f2e33f47b)

Yeah, it's the zooming (manually or by default) which wouldn't change using px values.

[Mark](https://hashnode.com/@mverleg)

[Sep 12, 2020](https://hashnode.com/posts/stop-using-pixels-in-css/5f5c5f0eddc3fe5f4f24cbbb/comment/5f5c7b77ddc3fe5f4f24ccda#reply-5f5cd2cb13599a5f2e33f4ce)

> if rem is directly proportional to px, what advantage does it possibly hold

The answer is that it isn't directly proportional. It depends on the font size. The formulas and converter work under the assumption of default font size.

It's like those measuring cups that have kg and liters, do you have one in your kitchen? They only measure liters, so the kg is a misleading lie. But because most kitchen-liquids have density close to that of water, it's a sort-of-useful trick anyway.

Same with rem and px: most users will be using 16px = 1rem so it's a good starting point, but the whole reason rem is better is because sometimes 1rem != 16px.

[Chris Bongers](https://hashnode.com/@dailydevtips)

[Sep 13, 2020](https://hashnode.com/posts/stop-using-pixels-in-css/5f5c5f0eddc3fe5f4f24cbbb/comment/5f5c7b77ddc3fe5f4f24ccda#reply-5f5ddf3c13599a5f2e33fb07)

[Mark](https://hashnode.com/@mverleg) Exactly is based on the root font-size (HTML) so hence I included that in my calculator.

You must keep in mind screenreaders and some mobile devices have a bigger font-size by default.

People could also use accessibility tools that don't necessary use the zoom function.
