4 ms·
One of those things I've just been subconsciously dealing with for years without ever deciding to actually learn the rules. "Damn it collapsed. Okay padding th
by koromak 3y ago
One of those things I've just been subconsciously dealing with for years without ever deciding to actually learn the rules.
"Damn it collapsed. Okay padding then"
- adasdasdas 3y agoLooks close enough to the design, ship it.
- marcosdumay 3y agoThe behavior is very obvious if you use them for text. (I have had a few cases of naively stating my margins, the browser exactly displaying what I meant, instead of what I thought I have said, and needing to understand why it worked.) Just don't use margins for layout, I guess.
- layer8 3y agoIt actually makes sense for laying out UI elements. Unfortunately there is no horizontal collapse.
- c-smile 3y agoJust in case, in my Sciter horizontal margins do collapse in horizontal flows: container { flow: horizontal; /* single row */ } container > child { margin:1em; /* will collapse */ } See: https://docs.sciter.com/docs/CSS/flows-and-flexes#flowhorizontal https://docs.sciter.com/docs/CSS/flows-and-flexes#flowhorizo...
- paulddraper 3y ago"IDK man, I just always use flexbox"
- bobthepanda 3y agoFlexbox and grids are the modern saviors of CSS. If only we had started with them.
- SoftTalker 3y agoI put everything in tables.
- indymike 3y agoThis was the way.
- qingcharles 3y agoI just space everything out with
- vidarh 3y agoThere's someone on HN with a blog where everything is split into Spans that then have widths set by JavaScript to precisely lay everything out with pixel precision. I was both impressed and appalled to see it.
- micromacrofoot 3y agoA lot of CSS works this way, until the fateful day you have to fix something and finally spend a day investigating how exactly it works.
- franky47 3y agoSame, though for me it's probably more like: "Add margin. More margin. Moooore margin!! Oh wait.."