To reset all styles to default in CSS, you can use a CSS reset stylesheet. A CSS reset stylesheet is a collection of CSS rules often used by web developers to ensure that styles are rendered consistently across different browsers. Eric Meyer and Nicholas Gallagher’s “Normalize.css” are two of the most commonly used CSS resets.
Here’s an example of a simple CSS reset:
```
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, 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;
}
```
This CSS reset remove all the spacing, borders, font sizes that browsers add.
However, please note that do not use it blindly, understand what you’re resetting and its purpose. Some rules might not be needed for your layout or some might even interfere with your styles.