From 969b96c2531fb986f6c7f21fd544391b439defd7 Mon Sep 17 00:00:00 2001 From: Jasper Ras Date: Mon, 13 Jan 2025 18:04:20 +0100 Subject: vault backup: 2025-01-13 18:04:20 --- .trash/1736752373 CSS relationships.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .trash/1736752373 CSS relationships.md (limited to '.trash/1736752373 CSS relationships.md') diff --git a/.trash/1736752373 CSS relationships.md b/.trash/1736752373 CSS relationships.md new file mode 100644 index 0000000..d997c1f --- /dev/null +++ b/.trash/1736752373 CSS relationships.md @@ -0,0 +1,22 @@ +css relationships +Elements live in relationship to each other + +parent -> child relationship : two-way. +width on children = auto; +area has to stay the same; less width -> more height +typical parent set width +margin-inline: auto -> margin left and right -> centers on screen. + +inheritence; ex font color is inherited by children. +==collapsing margins== -> child margin pushes down the parent (`display: flow-root;) +-> padding -> sides together = collapsing margin, after padding !sides together + +cssdemystified.com -> deep-dive in CSS internals + +siblings normally stack +flex, grid relationship more complex +different sized siblings can make things look weird; use flex or grid to set their width. + +flex; children influence siblings and parent +grid; more control over siblings. +padding : flex pushes on sibling so sibling is smaller, grid cell stays same; sibling dont affect each other. \ No newline at end of file -- cgit v1.2.3