Sponsor for just $1/mo and receive access to our private Discord server!

Slick­Stack
Lightning-fast WordPress on Nginx

The Last (Lightweight) CSS Reset You’ll Need

March 23, 2022

CSS resets have always been a pain in the neck, because of new elements and CSS options being released every few years. To make it more annoying, various browsers have decided to come up with their own default CSS settings in case they are undefined (and sometimes, even if they are defined).

Since our team works with custom WordPress themes on a regular basis, we thought it would be helpful to publish a minimal CSS reset.

We will try to keep this updated every so often when necessary, but by design it should be valid for the long-term. The idea is that pretty much every CSS element in existence is set to have zero margins, padding, and borders… along with inherit fonts and baseline alignment.

Last updated: 22 March, 2022

 

/* css reset */

html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, hr, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}

Last modified on March 23, 2022