I did use margin-bottom for some time and it has most of the advantages. Especially #1 (less code navigation) was what convinced me to switch.
You mean ~ *:not(br) right? You can also go with + br + * which is easier to understand.
Of course, with margin-bottom you don’t need the + cominator, but you will have a harder time if you have various preceding elements that need different spacing.
What are the advantages of margin-bottom that conviced you? Let me know!
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I use the exact opposite guideline for years in large (modular) projets, which is using
margin-bottom/rightand IMHO is way better,Your examples of CSS for
margin-topshouldn't be used, as it can cause a lot of issues in maintenance among others (eg: performance/speed),Also your point #3 I really can't see the difference from you top VS bottom.
About the headaches, no headaches at all, just a matter on how to do things properly
I did use
margin-bottomfor some time and it has most of the advantages. Especially #1 (less code navigation) was what convinced me to switch.You mean
~ *:not(br)right? You can also go with+ br + *which is easier to understand.Of course, with
margin-bottomyou don’t need the+cominator, but you will have a harder time if you have various preceding elements that need different spacing.What are the advantages of
margin-bottomthat conviced you? Let me know!