CSS initialization style

Source: Internet
Author: User

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,buttonform,fieldset,input,textarea,p,blockquote,     TH,TD {padding:0;   margin:0; }/* Modify */body {background: #fff; color: #333; font-size:12px; margin-top:5px;font-family: "SimSun", "Arial", "Soong Narrow" ;}  /* The content of the short reference may be the value: ' or ' ' */q:before,q:after {content: ';} /* abbreviation, picture without border */fieldset,img,abbr,acronym {border:0 none;} abbr,acronym {font-variant:normal;} Legend {color: #000;}     /* Clear the font and font size for special tags */address,caption,cite,code,dfn,em,strong,th,var {font-weight:normal;   Font-style:normal; }/* superscript */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;}. clear {Clear:both;}

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{    

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


reprinted from: Http://www.cnblogs.com/xiangzi888/archive/2011/09/21/2184442.html

CSS initialization style

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.