CSS reset is always the same?

Asked

Viewed 324 times

8

Is CSS Reset always the same, or are there others who maintain the same pattern but have more specific features? It is a rule that all CSS Reset be equal, that is, if I create mine with what is already expected and increment with something else would be wrong?

  • 4

    It’s not the same and the way the reset is done should depend on the project. There is no need to insert a file .css full of rules just because some blog recommends and calls it "good practice". If big, dfn, applet, object, etc do not exist on my page, there is no reason to be in my css. :)

  • Related, I recommend reading: http://answall.com/questions/100044/css-reset-ou-normalize/

1 answer

6

There are several types of Reset for Css. The best known and used by developers is the Generic Reset CSS

* {
    padding: 0;
    margin: 0;
    border: 0;
}

Another well-known and widely used model is also proposed by Eric Meyer

/* 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;
}

Among others, as shown in a post with the 10 Techniques for Resetting CSS.

Anyway, to answer your question objectively. It is not a rule to use a type of Reset Css, you can use existing templates, or create one according to your specific needs.

  • 5

    The initiative is interesting, I only suggest an update, because the most recent information mentioned is from 2008. Meyer itself updated the reset in 2011, with some HTML5 elements - what you posted is the 2007.

  • 1

    @Bacco I edited the response to the 2011 reset proposed by Meyer as quoted, thank you.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.