Sobes.tech
Junior

What is 'reset' CSS?.

sobes.tech AI

Answer from AI

'Reset' CSS is a set of styles that resets the browser's default styles for HTML elements. Browsers apply default styles (for example, margins, font sizes, border thicknesses), which can vary. Reset CSS makes these styles uniform, simplifying development and ensuring cross-browser compatibility.

Main tasks of reset CSS:

  • Removing default margins and paddings
  • Resetting header styles
  • Normalizing list styles
  • Resetting form field styles
  • Setting box-sizing: border-box;, which is often included in modern resets to simplify size calculations.

Example of a simple reset CSS fragment:

/* Reset default margins and paddings */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Remove default list styles */
ul, ol {
  list-style: none;
}

Various implementations of reset CSS exist, such as Eric Meyer's CSS Reset, Normalize.css (which is technically not a reset but a 'normalizer' that preserves useful default styles while making them uniform), or more minimalist solutions.