4 ms·
If you start thinking as margin as a relationship between two or more blocks instead of property on a block, some of the issues with it are solved. Whenever po
by pastelsky 7y ago
If you start thinking as margin as a relationship between two or more blocks instead of property on a block, some of the issues with it are solved.
Whenever possible, I try to use the sibling selector for this –
.header + .nav {
margin: //
}
This way, both header and nav elements remain re-usable and the margin only comes into play if they're used in a specific layout, and it is defined in its parent.