Layout & Box Properties
CSS · Methods reference
CSS · Methods reference
📋 Overview
Box model, positioning, display, overflow, and sizing.
🔧 Methods
Box model
| Property | Description |
|---|---|
width / height | Content size (with box-sizing) |
min-width / max-width / min-height / max-height | Bounds |
box-sizing | content-box |
margin / padding / border | Spacing and border shorthand |
aspect-ratio | Preferred width/height ratio |
Position & display
| Property | Description |
|---|---|
display | block |
position | static |
top / right / bottom / left | Offsets for positioned elements |
z-index | Stacking order (positioned/flex/grid) |
overflow / overflow-x / overflow-y | Clip or scroll |
visibility / opacity | Hide vs remove from layout |
object-fit / object-position | Replaced content sizing |
💡 Examples
See parent topic notes for runnable snippets; this page is the complete method index.
⚠️ Pitfalls
- Mutating methods return
Nonein Python — do not chainsort()/reverse()expecting a new list. - Default JS
sort()compares strings — pass(a,b) => a-bfor numbers. - SQL function names differ by dialect — verify Postgres vs MySQL docs.
- Django
QuerySet.update()skipssave()signals and autoauto_nowfields on models.