Why some people start with this in CSS file?

I’m training and some tutorials use this

  box-sizing: border-box;

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

What is the function of this code?


In case you don’t know, browsers apply their own default styles to all elements, hence this is a way to reset the styles and have a common ground to work on different browsers.

1 Like

For reference, check out what normalize.css is.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.