Obsessed with React and teaching. I help people become Frontend Developers. Living with my fiancee and Yorkshire Terrier 🐶 in Poland.
Discover Mentorship
The above is an affiliate link, if you buy the book I'll get a small commission at no extra charge to you.
Obsessed with React and teaching. I help people become Frontend Developers. Living with my fiancee and Yorkshire Terrier 🐶 in Poland.
The above is an affiliate link, if you buy the book I'll get a small commission at no extra charge to you.
Home/Pills/ Pill - Adjust box sizing in CSS/
Home/Pills/Pill - Adjust box sizing in.../
Image by Erda Estremera from Unsplash

Adjust box sizing in CSS

Dec 3, 2020

DESCRIPTION

Adjust box-sizing property to include padding and border to actual width or height. Simplifies overhead of the box model.

Preview

Border-box property

CSS

Summary

  • Add the above code to your main CSS file to take effect.
  • Select all selector targets all HTML elements, including all pseudo-elements.
  • Then, the box-sizing property is overridden to border-box instead of default content-box.
THE GUIDE TO BEAT FRONTEND INTERVIEW
From time to time, I'll send you messages about new blog posts, knowledge pills, and mentoring promotions. Only valuable information, no spam included. You can unsubscribe at any time.
slack
Let's build a community that will help each other.
spread the word
You don't need to, it's okay...