Skip to main content

Mini CSS reset

By September 29, 2016December 6th, 2016coding, CSS, Language-Learning

minireset.css is a tiny modern CSS reset that covers the basics:

  • resets the font sizes
  • so that using semantic markup doesn’t affect the styling

  • resets the block margins
  • so that the spacing is only applied when you need it

  • preserves the inline margins
  • so that buttons and inputs keep their default layout

  • sets the border-box box sizing
  • so that borders and paddings don’t affect the set dimensions

  • sets responsive media elements
  • so that images and embeds scale with the browser width

  • resets tables
  • so that tabular data only takes the space it needs


/*! minireset.css v0.0.2 | MIT License | github.com/jgthms/minireset.css */
html, body, p,
ol, ul, li,
dl, dt, dd,
blockquote, figure,
fieldset, legend, textarea,
pre, iframe, hr,
h1, h2, h3, h4, h5, h6 {
margin: 0;
padding: 0;
}

h1, h2, h3, h4, h5, h6 {
font-size: 100%;
font-weight: normal;
}

ul {
list-style: none;
}

button, input, select, textarea {
margin: 0;
}

html {
box-sizing: border-box;
}

* {
box-sizing: inherit;
}

*:before, *:after {
box-sizing: inherit;
}

img, embed, object, audio, video {
height: auto;
max-width: 100%;
}

iframe {
border: 0;
}

table {
border-collapse: collapse;
border-spacing: 0;
}

td, th {
padding: 0;
text-align: left;
}

credit source: minireset