#BoxModel

Ana Tudor 🐯anatudor
2025-02-19

PSA: not setting `height: 100%` to begin with on an element that has a `padding` is a better way of avoiding overflow than the nuclear solution of setting `box-sizing: border-box` on everything.

Live comparison on @codepen:

codepen.io/thebabydino/pen/vEY

Comparative screenshot showing the two solutions to the problem.
Abdelfattah Ragababdelfattahragab
2024-12-29

CSS Box Model and Layouts by Abdelfattah Ragab

Welcome to the book "CSS Box Model and Layouts".
In this book, I explain the properties of CSS box model such as width, height, margin, padding and so on.

Available on shop.tredition.com and amazon.com

CSS Box Model and Layouts by Abdelfattah Ragab
Abdelfattah Ragababdelfattahragab
2024-11-16

CSS Box Model and Layouts

Welcome to the book "CSS Box Model and Layouts".
In this book, I explain the properties of CSS box model such as width, height, margin, padding and so on.
By the end of this book, you will be able to position your box correctly on the page, control its size and spacing, and handle all kinds of scenarios.
Let us go!

you╭👺+300╭🐈x5╭⁂+3╭(Ⓐ+aunspeaker
2024-09-12

i don't see how that'll happen without implementing something like the though (making each component aware of its margin, border, padding, and content areas)

i'm trying to keep things simpler than that! although with a terse enough syntax some -like layout mechanic also becomes TEMPTING...

eh. nevermind.

so what if the composition order is a little counterintuitive. aint the only counterintuitive thing in life now is it

Nicklas Johnson 🏳️‍🌈spatula@tech.lgbt
2023-11-03

The CSS box model dooms us all.

#css #boxModel #webDevelopment

White text on a black background which would read "The CSS Box Model Dooms Us All" except that everything from halfway across the "A" in "All" is cropped out.

Client Info

Server: https://mastodon.social
Version: 2025.04
Repository: https://github.com/cyevgeniy/lmst