CSS Initialization code scheme

Source: Internet
Author: User

(from the already dead time and again finally hung out of the Baidu space manually rescued, published on 2014-06-24)

In order to eliminate the browser to the default CSS settings, keep the Web page in each browser look consistent, the initialization of CSS is very necessary! A lot of the time, the style incompatibility problem can be solved by CSS initialization code. Some common scenarios are listed below:

1. The most resource-consuming, simplest

2. Selective initialization example (synthesis)

Body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,legend,button

FORM,FIELDSET,INPUT,TEXTAREA,P,BLOCKQUOTE,TH,TD {

padding:0;

margin:0;

}

Comment: There is a problem with the above notation, which causes the browser to parse the exception. For unknown reasons, the following alternatives are recommended:

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, 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:none;

Outline:none;

font-size:100%;

Font:inherit;

Vertical-align:baseline;

}

Or:

body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,textarea,p,blockquote,th,td{ margin:0;padding:0;}

/* Modify as appropriate */

Body {

Background: #fff; color: #333; font-size:12px;font-family: "SimSun", "Song Body", "Arial Narrow";

}

/* The content of the short reference may be the value: ' or ' ' * *

Q:before,q:after {content: ";}

/* abbreviation, picture, etc. no border */

fieldset,img,abbr,acronym {border:0 none;}

abbr,acronym {font-variant:normal;}

Legend {color: #000;}

/* Clear font and font size for special tags */

Address,caption,cite,code,dfn,em,strong,th,var {

Font-weight:normal;

Font-style:normal;

}

/* Superscript/subscript */

sup {vertical-align:text-top;}

Sub {vertical-align:text-bottom;}

/* Sets the border of the table to be merged into a single border, specifying the distance between the cell boundaries in the delimited border model is 0*/

Table {

Border-collapse:collapse;

border-spacing:0;

}

/* table title and content left display */

caption,th {text-align:left;}

Input,img,select {vertical-align:middle;}

/* Clear List style */

Ol,ul {list-style:none;}

/* Input Control font */

input,button,textarea,select,optgroup,option {

Font-family:inherit;

Font-size:inherit;

Font-style:inherit;

Font-weight:inherit;

}

/* Header element style Clear */

H1,h2,h3,h4,h5,h6 {

Font-weight:normal;

font-size:100%;

}

/* Link style, color can be modified as appropriate */

del,ins,a {text-decoration:none;}

a:link {color: #009;}

a:visited {color: #800080;}

A:hover,a:active,a:focus {color: #c00; text-decoration:underline;}

/* Mouse Style */

Input[type= "Submit"] {Cursor:pointer;}

button {Cursor:pointer;}

Input::-moz-focus-inner {border:0; padding:0;}

3.sina of

/* Global Style */

body,ul,ol,li,p,h1,h2,h3,h4,h5,h6,form,fieldset,table,td,img,div{

margin:0;padding:0;border:0;

}

body{

Background: #fff; color: #333; font-size:12px; margin-top:5px;font-family: "SimSun", "Song Body", "Arial Narrow";

}

ul,ol{

List-style-type:none;

}

select,input,img,select{

Vertical-align:middle;

}

A{text-decoration:none;} A:link{color: #009;} A:visited{color: #800080;} A:hover,a:active,a:focus{color: #c00; text-decoration:underline;}

4.yahoo of

HTML {background:none Repeat scroll 0 0 #FFFFFF; Color: #000000;

}

Body, Div, DL, DT, DD, UL, OL, Li, H1, H2, H3, H4, H5, H6, pre, Code, form, fieldset, legend, input, textarea, p, blockquo TE, Th, td {

margin:0; padding:0;

}

Table {

Border-collapse:collapse; border-spacing:0;

}

FieldSet, img {

border:0 none;

}

Address, caption, cite, code, DFN, EM, strong, Th, var {

Font-style:normal; Font-weight:normal;

}

Li {

List-style:none outside 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 none; Font-variant:normal;

}

sup {

Vertical-align:text-top;

}

Sub {

Vertical-align:text-bottom;

}

Input, textarea, select {

Font-family:inherit;    Font-size:inherit; Font-weight:inherit;

}

Input, textarea, select {

}

Legend {

Color: #000000;

}

Body {

font:13px/1.231 Arial,helvetica,clean,sans-serif;

}

Select, input, button, textarea {

font:99% Arial,helvetica,clean,sans-serif;

}

Table {

Font-size:inherit;

}

Pre, code, KBD, Samp, TT {

Font-family:monospace; line-height:100%;

}

A

Text-decoration:none;

}

A:hover, A:focus {

Text-decoration:underline;

}

Strong {

Font-weight:bold;

}

Input[type= "Submit"] {

Cursor:pointer;

}

button {

Cursor:pointer;}

5. The Blog Park

/*version:2.7.0*

/html, Body {

Color: #000;

Background: #FFF;

}

Body, Div, DL, DT, DD, UL, OL, Li, H1, H2, H3, H4, H5, H6, pre, Code, form, fieldset, legend, Input, button, 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, optgroup {

Font-style:inherit;

Font-weight:inherit;

}

Del, ins {text-decoration:none;}

Li {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;

Font-variant:normal;

}

sup {vertical-align:baseline;}

Sub {vertical-align:baseline;}

Legend {color: #000;}

Input, button, textarea, select, optgroup, option {

Font-family:inherit;

Font-size:inherit;

Font-style:inherit;

Font-weight:inherit;

}

Input, button, textarea, select {*font-size:100%;

}

. clear {Clear:both;}

Input::-moz-focus-inner {

border:0;

padding:0;

}/*added*/

Input[type=button], Input[type=submit] {-webkit-appearance:button;}

"Personal Collection"

CSS Initialization code scheme

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.