3 ms·
Another interesting rule: when margin/padding is a percentage, it is always a percentage of the width, never the height. This makes sense, CSS layout is comput
by emadda 3y ago
Another interesting rule: when margin/padding is a percentage, it is always a percentage of the width, never the height.
This makes sense, CSS layout is computed with logical rules/programming.
I think the “illogical” reputation comes from people not knowing which rules apply. They cannot see how the current layout output was calculated by the given css properties.
This is due to CSS being backwards compatible and constantly adding new ways to do things. But you can choose to use the “good parts” of the language as Douglas Crockford would say (for JS).
Also many people assume CSS would be easy and brush off that it requires a bit of effort and practise to learn the language.
I created an interactive grid explainer here if anyone is interested, I think grid is one of the good parts.
https://cssprinciples.com/3/grid https://cssprinciples.com/3/grid