Reset Default Style CSS Reset

Source: Internet
Author: User

HTML {
Overflow-x:auto;
Overflow-y:scroll;
}
Body, DL, DT, DD, UL, OL, Li, Pre, form, fieldset, input, p, blockquote, TH, TD {
font-weight:400;
margin:0;
padding:0;
}
H1, H2, H3, H4, H4, H5 {
margin:0;
padding:0;
}
Body {

Color: #666666;
Font-family:helvetica,arial,sans-serif;
font-size:12px;
padding:0 10px;
Text-align:left;
}
Select {
font-size:12px;
}
Table {
Border-collapse:collapse;
}
FieldSet, img {
border:0 none;
}
fieldset {
margin:0;
padding:0;
}
FieldSet p {
margin:0;
padding:0 0 0 8px;
}
Legend {
Display:none;
}
Address, caption, EM, strong, Th, I {
Font-style:normal;
font-weight:400;
}
Table Caption {
margin-left:-1px;
}
HR {
border-bottom:1px solid #FFFFFF;
border-top:1px solid #E4E4E4;
BORDER-WIDTH:1PX 0;
Clear:both;
height:2px;
margin:5px 0;
Overflow:hidden;
}
OL, UL {
List-style-image:none;
List-style-position:outside;
List-style-type:none;
}
caption, Th {
Text-align:left;
}
Q:before, Q:after, Blockquote:before, Blockquote:after {
Content: "";
}

Baidu has AH (www.youa.com): (architecture is basically imitating Yui to do)
Body {
Font-family:arial,helvetica,sans-serif;
font-size:13px;
Font-size-adjust:none;
Font-stretch:normal;
Font-style:normal;
Font-variant:normal;
Font-weight:normal;
line-height:1.4;
Text-align:center;
}
Body, UL, OL, DL, DD, H1, H2, H3, H4, H5, H6, p, form, fieldset, legend, input, textarea, select, button, TH, TD {
margin:0;
padding:0;
}
H1, H2, H3, H4, H5, h6 {
font-size:100%;
Font-weight:normal;
}
Table {
Font-size:inherit;
}
Input, select {
Font-family:arial,helvetica,clean,sans-serif;
font-size:100%;
Font-size-adjust:none;
Font-stretch:normal;
Font-style:normal;
Font-variant:normal;
Font-weight:normal;
Line-height:normal;
}
button {
overflow:visible;
}
Th, EM, strong, B, address, cite {
Font-style:normal;
Font-weight:normal;
}
Li {
List-style-image:none;
List-style-position:outside;
List-style-type:none;
}
IMG, fieldset {
border:0 none;
}
INS {
Text-decoration:none;
}
In the book "Beyond CSS," we recommend that we do the site to start resetting all default styles:
/* normalizes margin,padding */
BODY,DIV,DL,DT,DD,UL,OL,LI,H1,H2,H3,H4,H5,H6,PRE,FORM,FIELDSET,INPUT,P,BLOCKQUOTE,TH,TD {margin:0;padding:0}
/* normalizes font-size for headers */
H1,h2,h3,h4,h5,h6 {font-size:100%}
/* Removes List-style from lists */
Ol,ul {List-style:none}
/* normalizes font-size and font-weight to normal */
Address,caption,cite,code,dfn,em,strong,th,var {font-size:normal; Font-weight:normal}
/* Removes List-style from lists */
Table {border-collapse:collapse; border-spacing:0}
/* Removes border from fieldset and IMG */
fieldset,img {border:0}
/* left-aligns text in caption and th */
caption,th {Text-align:left}
/* Removes quotation marks from Q */
Q:before,q:after {content: '}
So what do we do with CSS reset when we actually write code?
I personally recommend using the CSS Reset (Eric Meyer and Yui)
Eric Meyer ' s 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,
b, u, I, center,
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-size:100%;
Vertical-align:baseline;
Background:transparent;
}
Body {
Line-height:1;
}
OL, UL {
List-style:none;
}
BLOCKQUOTE, Q {
Quotes:none;
}
Blockquote:before, Blockquote:after,
Q:before, Q:after {
Content: ";
Content:none;
}
/* Remember to define focus styles! */
: Focus {
outline:0;
}
/* Remember to highlight inserts somehow! */
INS {
Text-decoration:none;
}
del {
Text-decoration:line-through;
}
/* Tables still need ' cellspacing= "0" ' in the markup * *
Table {
Border-collapse:collapse;
border-spacing:0;
}
YUI:
BODY,DIV,DL,DT,DD,UL,OL,LI,H1,H2,H3,H4,H5,H6,PRE,FORM,FIELDSET,INPUT,TEXTAREA,P,BLOCKQUOTE,TH,TD {
margin:0;
padding:0;
}
Table {
Border-collapse:collapse;
border-spacing:0;
}
fieldset,img {
border:0;
}
Address,caption,cite,code,dfn,em,strong,th,var {
Font-style:normal;
Font-weight:normal;
}
Ol,ul {
List-style:none;
}
caption,th {
Text-align:left;
}
H1,h2,h3,h4,h5,h6 {
font-size:100%;
Font-weight:normal;
}
Q:before,q:after {
Content: ";
}
abbr,acronym {border:0;
}
Combined with their CSS reset, and then according to their actual situation, will be able to write the perfect CSS reset in line with their own website.

Reset Default Style CSS Reset

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.