In the past when writing HTML code, the general will be added to the head of the Reset.css style, the content is as follows:
@charset "Utf-8"; HTML, body, Div, span, applet, object, IFRAME,H1, H2, H3, H4, H5, H6, p, blockquote, Pre,a, abbr, ACR onym, 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%;/*background:transparent;*/}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:200%;Font-weight:Normal;}: Focus{Outline:0;}a{text-decoration:None;}a:hover img{Border:None;}a:active{Nooutline:expression (This.onfocus=this.blur ());}/*Clear Floating*/. Clearfix:after{content: ".";Display:Block;Height:0;Clear:both;Visibility:Hidden;}. Clearfix{Display:Inline-block;}/*hides from Ie-mac \*/* HTML. Clearfix{Height:1%;}. Clearfix{Display:Block;}/*End Hide from Ie-mac*//*png css hack for IE6*/*html img.png{_background-image:expression (this.runtimeStyle.backgroundImage = "None", This.runtimeStyle.filter = "progid:d XImageTransform.Microsoft.AlphaImageLoader (src= ' + this.src + "', sizingmethod= ' image ')", this.src = "/http/ I0.itc.cn/20101019/848_0a785a7b_1118_4825_85dc_e8696988c94b_0.gif ");}
But recently viewed online articles on the Internet, also feel that some reset is useless. Why is it?
What is the role of reset?
CSS Reset's role is to make the CSS style of each browser have a unified benchmark, and this benchmark is more "clear 0"!
Sometimes there are some resets to someone's website station:
* { margin:0; padding:0; }
Such a writing is highly recommended.
Now see reset Table discovery:
1. Does the div tag have margin value by default? Do you have a padding value? How can think of application div{margin:0; padding:0;} What about properties? The answer is certainly not.
2. The DT tag has the default margin and padding value is 0, what also to use?
3. Does the Li tag have margin value by default? Do you have a padding value? No!
4. The code tag is an inline level element that also pulls the reset of margin and padding, which is not necessary.
5. FieldSet, legend These two 90 's tags used on your website? It is not necessary to use a label with less than 1% probability to reset it.
CSS really reset is just a few of the commonly used tags, your page is generally used to what tags?
body, DL, DD, H1, H2, H3, H4, H5, H6, p, form {margin:0;} ol,ul{margin:0; padding:0;}
This kind of CSS reset is efficient, concise, and some other tags can be removed, no need.
Of course, the advantages of CSS reset, the shortcomings are not said, estimated that the heart is very few, or to be based on the actual project.
Later, the supervisor recommended me an alternative to reset.css replacement, which is to use normalize.css. Make a list of its usage in the following article.
See the Rainbow after the rain
Source: http://www.cnblogs.com/moqiutao/
If you feel that this article is helpful to your study, please support and encourage more.
is the CSS reset style so important?