DEV Community

Discussion on: Things I Wish I’d Known About CSS

Collapse
 
yevgalis profile image
yevgalis
.some-class {
        width: 50%;
        padding: 2em;
        border: 0.1rem;
}

The total calculated width for .some-class would be:
50% + 2em + 0.1rem

It will actually be 50% + 4em + 0.2rem, because you use padding and border and not just padding-left (right) / border-left (right)

Collapse
 
websmyth profile image
Dave Smyth

Ahhhh, of course! 🤦🏻‍♂️

Consider it updated. Thanks 🙌