How to describe element’s natural sizing behavior

PPK:

When introducing width and height I explain that by default width takes as much horizontal space as it can, while height takes as little vertical space as possible. This leads to a discussion of these two opposed models

The post How to describe element’s natural sizing behavior appeared first on CSS-Tricks. You can support CSS-Tricks by being an MVP Supporter.

https://css-tricks.com/how-to-describe-elements-natural-sizing-behavior/

Vytvořeno 4y | 26. 3. 2021 22:20:42


Chcete-li přidat komentář, přihlaste se

Ostatní příspěvky v této skupině

Color Everything in CSS

An introduction to "Color spaces", "Color models", "Color gamuts," and basically all of the "Color somethings" in CSS.


20. 6. 2025 15:20:14 | CSS tricks
CSS Color Functions

CSS has a number of functions that can be used to set, translate, and manipulate colors. Learn what they are and how they are used with a bunch of examples to get you started.


19. 6. 2025 16:10:13 | CSS tricks
How to Keep Up With New CSS Features

How do you stay informed of new CSS features when the language evolves quickly and information is spread all around the web? Sacha Greif has some tips from his work running an annual survey focused

17. 6. 2025 15:20:16 | CSS tricks
A Better API for the Resize Observer

ResizeObserver, MutationObserver, and IntersectionObserver enhance performance over their predecessors. Zell discusses their API similarities, usage steps, refactoring strategies, and advantages wi

16. 6. 2025 13:50:11 | CSS tricks
Breaking Boundaries: Building a Tangram Puzzle With (S)CSS

We put it to the test and it turns out Sass can replace JavaScript, at least when it comes to low-level logic and puzzle behavior. With nothing but maps, mixins, functions, and a whole lot of math,

12. 6. 2025 14:50:07 | CSS tricks
Creating an Auto-Closing Notification With an HTML Popover

The HTML popover attribute transforms elements into top-layer elements that can be opened and closed with a button or JavaScript. Popovers can be dismissed a number of ways, but there

9. 6. 2025 14:50:20 | CSS tricks
Better CSS Shapes Using shape() — Part 3: Curves

This is the third article in a series about the CSS shape() function. We've covered drawing lines and arcs in previous articles and, this time, we look specifically at the curve

6. 6. 2025 15:10:24 | CSS tricks