A complete guide to CSS units

Everything You Need to Know About CSS Units

There are currently 15 different CSS units that browsers support, and the majority of them are unknown by most. In this tutorial, you’ll be going to learn everything you need to know about CSS units. In order, we are going to take a look at the following:

  • Pixels
  • Points
  • Centimeters
  • Millimeters
  • Inches
  • Picas
  • Percentages
  • Font units
  • Viewport dimensions

If you’re only interested in some of them, feel free to jump to the relevant section.

We can break down CSS units into two categories. A unit can be either an absolute length or a relative length. Let’s see what is the…

Ferenc Almasi

💻 Frontend dev with a passion for beautiful code • 🐦 Tweets webtips on twitter • ✍️ Writes on webtips.dev • Get in touch @ hello@allma.si or visit allma.si 👋

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store