Meyerweb CSS Reset

Hi all,

I’ve been learning a little bit about resets to abolish all default settings the browser applies. I used a border on all elements to see the difference which I found pretty intriguing- Fascinating to see exactly how things are being displayed/interpreted with boxes visible.
I was wondering if anyone has any idea what the browser is actually adding (I used Chrome).
I’ve pasted some code below and the results both before and after using a reset. Does anyone understand what exactly is happening when the reset isn’t applied and why there appear to be a number more boxes?
And also is it good practice just to always use a reset so that you are completely controlling all the elements when you’re building?
Thanks.

Positioning Content

Test

BEFORE reset

AFTER reset

Where is the code? :sunny:

Oops… Here it is. (It’s just a basic set up):

<!DOCTYPE html>
<html>
<head>
	<title>Positioning</title>
	<link rel="stylesheet" href="css/stylesheet2.css">
</head>
<body>
<p>Test</p>
</body>
</html>

You can tell I’m new at this, lol. Code below:

/* http://meyerweb.com/eric/tools/css/reset/
   v2.0 | 20110126
   License: none (public domain)
*/

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;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
  display: block;
}
body {
  line-height: 1;
}
ol, ul {
  list-style: none;
}
blockquote, q {
  quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
  content: '';
  content: none;
}
table {
  border-collapse: collapse;
  border-spacing: 0;
}

I used the code to show all the borders:

*  { 
    border: red solid 1px !important;
}

Totally makes sense. So helpful to understand how each browser sets its own defaults that you can over-ride. Is this generally good practice to reset or should I just leave to the browsers default settings?

Thanks @camperextraordinaire, I’ll have a read.