The reset function of the CSS reset (desirable or not, depending on you)

Source: Internet
Author: User
Tags benchmark

I. Reasons for the Reset

In today's popular browser, some of them are in their own way to understand the CSS specification, this will be only the browser to the CSS interpretation and the designer's CSS definition of the original intention of the conflict, so that the appearance of the Web page in some browsers can be correctly displayed according to the designer's ideas. But some browsers don't show up as the designers want them to, which leads to browser compatibility issues

So, by resetting the CSS property of the button tag and then defining it uniformly, you can produce the same display effect

  The role of CSS Reset is to make each browser CSS style has a unified benchmark, and this benchmark is more "clear 0"!

The following is a full section of CSS Reset's style reset information displayed:

1 html, body, Div, span, object, IFRAME,2 H1, H2, H3, H4, H5, H6, p, blockquote, Pre,3 abbr, address, cite, code,4 del, DFN, EM, img, INS, KBD, Q, Samp,5 small, strong, sub, SUP, VAR,6 B, I,7 DL, DT, DD, OL, UL, Li,8 fieldset, form, label, legend,9 table, Caption, Tbody, TFOOT, THEAD, tr, TH, TD,Ten article, aside, canvas, details, figcaption, figure, One footer, Header, Hgroup, menu, nav, section, summary, A Time , mark, audio, video{ - margin:0; - padding:0; the Border:0; - Outline:0; - font-size:100%; - vertical-align:Baseline; + background:Transparent; -} +  A Body{ at Line-height:1; -} -  - : Focus{ - Outline:1; -} in  - Article,aside,canvas,details,figcaption,figure, to footer,header,hgroup,menu,nav,section,summary{ + Display:Block; -} the  * Nav ul{ $ List-style:None;Panax Notoginseng} -  the blockquote, Q{ + Quotes:None; A} the  + Blockquote:before, Blockquote:after, - Q:before, Q:after{ $ content:"'; $ content:None; -} -  the a{ - margin:0;Wuyi padding:0; the Border:0; - font-size:100%; Wu vertical-align:Baseline; - background:Transparent; About} $  - ins{ - Background-color:#ff9; - Color:#000; A text-decoration:None; +} the  - Mark{ $ Background-color:#ff9; the Color:#000; the Font-style:Italic; the Font-weight:Bold; the} -  in del{ the text-decoration:Line-through; the} About  the Abbr[title], Dfn[title]{ the Border-bottom:1px dotted #000; the cursor: Help; +} -  the Table{Bayi Border-collapse:collapse; the border-spacing:0; the} -  - HR{ the Display:Block; the Height:1px; the Border:0; the Border-top:1px solid #cccccc; - margin:1em 0; the padding:0; the} the 94 input, select{ the vertical-align:Middle; the}

For the above code, I do the following several notes:

1. This part is for the browser part of the CSS to reset, personally think not all the code is required to do so, after all, there are many tags in the process of writing your page does not necessarily use

2. According to their actual situation to choose the appropriate code to use, do not copy, this is the experience summed up by predecessors

The above code can also be simplified into the following code form:

1 body, DL, DD, H1, H2, H3, H4, H5, H6, p, form {2    margin:0;  34  ol,ul{5    margin:0;  6    padding:0;  7 }

According to the actual situation reasonable use of the relevant reset code, because if your CSS file itself is relatively large, add the relevant reset code will also make your CSS file larger point, for the company, this is not access to!!!

The reset function of the CSS reset (desirable or not, depending on you)

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.