---
title: "Discussion on \"px vs rem vs em vs %\" | Hashnode"
description: "Discussion on \"px vs rem vs em vs %\". This is where people overthink. Here’s the real-world rule set.\n\n🔹 Use px for:\n✔ Borders✔ Shadows✔ Small offsets✔ Hairline precision\nborder-radius: 6px;\nbox-shadow: 0 1px 4px rgba(0,0,0,.2);\n\n\npx = physical precision\n\n\n🔹 Use rem for:\n✔ Font sizes✔ ..."
url: "https://hashnode.com/posts/px-vs-rem-vs-em-vs/69823d22d9f0256419abf892"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [px vs rem vs em vs %](https://adityago.hashnode.dev/px-vs-rem-vs-em-vs?utm_source=hashnode&utm_medium=feed)

This is where people overthink. Here’s the real-world rule set. 🔹 Use px for: ✔ Borders✔ Shadows✔ Small offsets✔ Hairline precision border-radius: 6px; box-shadow: 0 1px 4px rgba(0,0,0,.2); px = physical precision 🔹 Use rem for: ✔ Font sizes✔ ...

Feb 3 · 2 min read · adityago.hashnode.dev  
Read the article

-   [#em](https://hashnode.com/tag/em)
-   [#rem](https://hashnode.com/tag/rem)
-   [#px](https://hashnode.com/tag/px)
-   [#px-rem-and-em](https://hashnode.com/tag/px-rem-and-em)

## Written by

[Aditya Goswami](https://hashnode.com/@Aditya-goswami)

@Aditya-goswami

  
[View profile](https://hashnode.com/@Aditya-goswami)

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
