What is the difference between px, em and ex?
css
Solution
- Pixels (`px`) are browser dependent. It is the absolute size that you would see on your screen.
- `Em` are sort of like percentages. `Em`s is referring to the base text size. The value of `1 em` means the same thing as a value of `100 percent`. But you can also say it in the opposite way: A percentage value is just an `em` multiplied by 100.
- Points(`pt`) are what you would want to use in print media.
Problem
What is the difference between `px`, `em` and `ex`? And when you define font-size in CSS, do you use `px`, `pt` or `em`?