Pro tip: the sans-serif font family

If you’re like me and spend a lot of time writing CSS, here is a tip that can save some characters.

When we want to use the sans-serif fonts, we usually declare it like this :

.something {
    font-family: Helvetica, Arial, sans-serif;
}

This complete font-family tells to work with Helvetica first, then to fall back on Arial and on the generic sans-serif as a last resort. You actually don’t need that complete family declaration. You can just use :

.something {
    font-family: sans-serif;
}

And sans-serif will automatically select the most appropriate one.

72d699932c095c46ce61fd7a69a2f7cb$$$$