CSS reset for 10 browsers

Source: Internet
Author: User

Do you know what CSS reset is? In general, it is also written as reset CSS, that is, resetting the style of the browser. In various browsers, some default values are used for CSS selectors. For example, if H1 is not set, a certain size is displayed. However, not all browsers use the same value. Therefore, with CSS reset, the webpage style is consistent in different browsers.

You are using CSS. Have you used CSS reset? Of course, you may have used it, but you do not know that it is in use. For example, you may have used:

* {Padding: 0; margin: 0; Border: 0 ;}

This is also a CSS reset method that sets the padding, margin, and border values of all selectors to 0. This is a powerful method and the simplest and safest method. However, it is also the most resource-consuming method. For small websites, using this will not cause a great waste of resources, but if it is a website with a very large architecture like Yahoo, you just need to selectively reset CSS, to reduce resource waste. Below is Yahoo's CSS resettingCodeIs also the most popular CSS reset method. The Yui method is as follows:

Body, Div, DL, DT, DD, UL, ol, Li, H1, H2, H3, H4, H5, H6, pre,
Form, fieldset, input, textarea, P, BLOCKQUOTE, Th, TD {
Padding: 0;
Margin: 0;
}
Table {
Border-collapse: collapse;
Border-Spacing: 0;
}
Fieldset, IMG {
Border: 0;
}
Address, caption, cite, code, dfn, em, strong, Th, VAR {
Font-weight: normal;
Font-style: normal;
}
OL, UL {
List-style: none;
}
Caption, Th {
Text-align: left;
}
H1, H2, H3, H4, H5, H6 {
Font-weight: normal;
Font-size: 100%;
}
Q: before, Q: After {
Content :";
}
Abbr, acronym {border: 0;
}
OK. I believe you have understood the purpose of CSS resetting. Maybe you can write your own CSS resetting System Based on your preferences, after all, the requirements and habits of everyone are different. You can refer to the following:

Ateneu popular 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, Font, IMG, INS,
KBD, Q, S, SAMP, small, strike, strong, sub, sup, TT,
VaR, DL, DT, DD, ol, UL, Li, fieldset, form, label, legend,
Table, caption, tbody, tfoot, thead, TR, Th, TD {
Margin: 0;
Padding: 0;
Border: 0;
Outline: 0;
Font-weight: Inherit;
Font-style: Inherit;
Font-size: 100%;
Font-family: Inherit;
Vertical-align: baseline;
}
: Focus {outline: 0 ;}
A, A: Link, A: visited, A: hover, A: active {text-Decoration: None}
Table {border-collapse: Separate; border-Spacing: 0 ;}
Th, TD {text-align: Left; font-weight: normal ;}
IMG, IFRAME {border: none; text-Decoration: none ;}
OL, UL {list-style: none ;}
Input, textarea, select, buttons {font-size: 100%; font-family: Inherit ;}
Select {margin: Inherit ;}
HR {margin: 0; padding: 0; Border: 0; color: #000; Background-color: #000; Height: 1px}

Chris Poteet's reset CSS
*{
Vertical-align: baseline;
Font-family: Inherit;
Font-style: Inherit;
Font-size: 100%;
Border: none;
Padding: 0;
Margin: 0;
}
Body {
Padding: 5px;
}
H1, H2, H3, H4, H5, H6, P, pre, BLOCKQUOTE, form, UL, ol, DL {
Margin: 20px 0;
}
Li, DD, BLOCKQUOTE {
Margin-left: 40px;
}
Table {
Border-collapse: collapse;
Border-Spacing: 0;
}

Eric Meyer reset CSS
HTML, body, Div, span, applet, object, IFRAME, table, caption,
Tbody, tfoot, thead, TR, Th, TD, Del, dfn, em, Font, IMG, INS,
KBD, Q, S, SAMP, small, strike, strong, sub, sup, TT, VAR,
H1, H2, H3, H4, H5, H6, P, BLOCKQUOTE, pre, A, abbr,
Acronym, address, big, cite, code, DL, DT, DD, ol, UL, Li,
Fieldset, form, label, legend {
Vertical-align: baseline;
Font-family: Inherit;
Font-weight: Inherit;
Font-style: Inherit;
Font-size: 100%;
Outline: 0;
Padding: 0;
Margin: 0;
Border: 0;
}
: Focus {
Outline: 0;
}
Body {
Background: white;
Line-Height: 1;
Color: black;
}
OL, UL {
List-style: none;
}
Table {
Border-collapse: Separate;
Border-Spacing: 0;
}
Caption, Th, TD {
Font-weight: normal;
Text-align: left;
}
BLOCKQUOTE: before, BLOCKQUOTE: After, Q: before, Q: After {
Content :"";
}
BLOCKQUOTE, q {
Quotes :"""";
}
Tantek Celik reset CSS
: Link,: visited {text-Decoration: None}
Ul, Ol {list-style: None}
H1, H2, H3, H4, H5, H6, pre, code {font-size: 1em ;}
Ul, ol, Li, H1, H2, H3, H4, H5, H6, pre, form, body, HTML, P, BLOCKQUOTE, fieldset, input
{Margin: 0; padding: 0}
A img,: link IMG,: visited IMG {border: None}
Address {font-style: normal}
Christian Montoya reset CSS
HTML, body, form, fieldset {
Margin: 0;
Padding: 0;
Font: 100%/120% verdana, Arial, Helvetica, sans-serif;
}
H1, H2, H3, H4, H5, H6, P, pre,
BLOCKQUOTE, UL, ol, DL, address {
Margin: 1em 0;
Padding: 0;
}
Li, DD, BLOCKQUOTE {
Margin-left: 1em;
}
Form label {
Cursor: pointer;
}
Fieldset {
Border: none;
}
Input, select, textarea {
Font-size: 100%;
Font-family: Inherit;
}
Rudeworks reset CSS
*{
Margin: 0;
Padding: 0;
Border: none;
}
HTML {
Font: 62.5% "lucida Grande", lucida, verdana, sans-serif;
Text-Shadow: #000 0px 0px 0px;
}
Ul {
List-style: none;
List-style-type: none;
}
H1, H2, H3, H4, H5, H6, P, pre,
BLOCKQUOTE, UL, ol, DL, address {
Font-weight: normal;
Margin: 0 0 1em 0;
}
Cite, em, dfn {
Font-style: italic;
}
Sup {
Position: relative;
Bottom: 0.3em;
Vertical-align: baseline;
}
Sub {
Position: relative;
Bottom:-0.2em;
Vertical-align: baseline;
}
Li, DD, BLOCKQUOTE {
Margin-left: 1em;
}
Code, KBD, SAMP, pre, TT, VAR, input [type = 'text'], textarea {
Font-size: 100%;
Font-family: Monaco, "lucida console", courier, mono-space;
}
Del {
Text-Decoration: Line-through;
}
INS, dfn {
Border-bottom: 1px solid # CCC;
}
Small, sup, sub {
Font-size: 85%;
}
Abbr, acronym {
Text-transform: uppercase;
Font-size: 85%;
Letter-Spacing:. 1em;
Border-bottom-style: dotted;
Border-bottom-width: 1px;
}
A abbr, A acronym {
Border: none;
}
Sup {
Vertical-align: Super;
}
Sub {
Vertical-align: Sub;
}
H1 {
Font-size: 2em;
}
H2 {
Font-size: 1.8em;
}
H3 {
Font-size: 1.6em;
}
H4 {
Font-size: 1.4em;
}
H5 {
Font-size: 1.2em;
}
H6 {
Font-size: 1em;
}
A, A: Link, A: visited, A: hover, A: active {
Outline: 0;
Text-Decoration: none;
}
A img {
Border: none;
Text-Decoration: none;
}
IMG {
Border: none;
Text-Decoration: none;
}
Label, button {
Cursor: pointer;
}
Input: focus, select: focus, textarea: Focus {
Background-color: # FFF;
}
Fieldset {
Border: none;
}
. Clear {
Clear: both;
}
. Float-left {
Float: left;
}
. Float-right {
Float: right;
}
Body {
Text-align: center;
}
# Wrapper {
Margin: 0 auto;
Text-align: left;
}
Anieto2k reset CSS
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, Font, IMG,
INS, KBD, Q, S, SAMP, small, strike,
Strong, sub, sup, TT, VAR, DL, DT, DD, ol, UL, Li,
Fieldset, form, label, legend,
Table, caption, tbody, tfoot, thead, TR, Th, TD,
Center, U, B, I {
Margin: 0;
Padding: 0;
Border: 0;
Outline: 0;
Font-weight: normal;
Font-style: normal;
Font-size: 100%;
Font-family: Inherit;
Vertical-align: Baseline
}
Body {
Line-Height: 1
}
: Focus {
Outline: 0
}
OL, UL {
List-style: None
}
Table {
Border-collapse: collapse;
Border-Spacing: 0
}
BLOCKQUOTE: before, BLOCKQUOTE: After, Q: before, Q: After {
Content :""
}
BLOCKQUOTE, q {
Quotes :""""
}
Input, textarea {
Margin: 0;
Padding: 0
}
HR {
Margin: 0;
Padding: 0;
Border: 0;
Color: #000;
Background-color: #000;
Height: 1px
}

Csslab 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, Font, IMG, INS, KBD, Q, S, SAMP,
Small, strike, strong, sub, sup, TT, VAR, DL, DT, DD, ol, UL, Li,
Fieldset, form, label, legend, table, caption, tbody, tfoot,
Thead, TR, Th, TD {
Margin: 0;
Padding: 0;
Border: 0;
Outline: 0;
Font-weight: Inherit;
Font-style: Inherit;
Font-size: 100%;
Font-family: Inherit;
Vertical-align: baseline;
}
: Focus {
Outline: 0;
}
Table {
Border-collapse: Separate;
Border-Spacing: 0;
}
Caption, Th, TD {
Text-align: left;
Font-weight: normal;
}
A img, IFRAME {
Border: none;
}
OL, UL {
List-style: none;
}
Input, textarea, select, button {
Font-size: 100%;
Font-family: Inherit;
}
Select {
Margin: Inherit;
}
/* Fixes incorrect placement of numbers in Ol's in IE6/7 */
Ol {margin-left: 2em ;}
/* = Clearfix = */
. Clearfix: After {
Content :".";
Display: block;
Height: 0;
Clear: both;
Visibility: hidden;
}
. Clearfix {display: inline-block ;}
* Html. Clearfix {Height: 1% ;}
. Clearfix {display: block ;}
As you can see, these are similar, and the methods vary depending on different requirements. I prefer Yahoo CSS reset and use Yahoo code. Do you have your own CSS Reset System? Maybe you can share it!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.