Hacker News new | ask | show | jobs
by marcosdumay 1007 days ago
The 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.

1 comments

It actually makes sense for laying out UI elements. Unfortunately there is no horizontal collapse.
Just 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#flowhorizo...