Last Updated: February 25, 2016
· derrybirkett

Tip for applying CSS Rules

I imported into my CSS development some rules I used to apply when building Flash apps. Namely, when relating two objects - add modifying CSS to the second element, never the first.

For example - Instead of adding margin-bottom to your main banner to create space for elements underneath - rather, add margin top the "child" elements and remove margin-bottom from the first.

Why do this? It's simply a rule so that when editing CSS, you know which element to apply it to. Sometimes it can be difficult to choose where to change CSS. This takes away the doubt.

I do this because, in my personal imaginarium, the first object knows nothing (in theory) of the subsequent element, but at least the second element does have an object to which it can relate.

Kinda weird I know. But it works for me! (and gives personality to objects - maybe)

Have a nice day!