|<<>>|11 of 339 Show listMobile Mode

CSS is a collection of layout algorithms

Published by marco on

 This is a nice explanation of how CSS is a declarative language, where you describe the metadata of your styles. The layout algorithm determines which property values affect the size and position of the element. Generally the properties position and display properties determine which layout algorithm is used for a given element. The layouts are,

CSS makes sense when you realize it's a collection of algorithms by Kevin Powell (YouTube)

Most properties work the same in all layouts. Some properties only have an effect in a specific layout mode, e.g., grid-template-columns is ignored if the layout is not grid. Other properties are interpreted differently or completely ignored depending on layout mode, e.g., width and margin are ignored in the inline layout.