Web design: Resetting CSS style sheets

Source: Internet
Author: User

Transfer from watercress: http://www.douban.com/note/330400235/

Web design: Resetting CSS style sheets


Web design, the most headache is to make the page compatible with the major browsers, accurate is compatible with their "default" CSS style sheet. In this way, the "erase" of these default style sheets is the first issue, there is a CSS style sheet reset, the current use of the most, but also the way you are now using, add the following code:

The first way

{margin:0px; padding:0px;}

Now many designers found that this line of code, although simple, but let the page parsing is too slow, hehe, of course, they are amateur, do not care too much.
There are several CSS reset methods:

The second way
Nettuts on the Jeffrey to write an article weekend Quick tip:create Your Own Simple reset.css File
Release the method you used to reset the CSS style sheet

1 body, HTML, div, BLOCKQUOTE, IMG, label, p, H1, H2, H3, H4, H5, H6, PRE, UL, OL,2 Li, DL, DT, DD, form, a, fieldset, input, TH, TD3{margin:0;padding:0;Border:0;Outline:None;}4 Body{Line-height:1;font-size:88%/*Decide for yourself if your want to include this.*/;}5 H1, H2, H3, H4, H5, H6{font-size:100%;padding:. 6em 0;margin:0 15px;}6 UL, Ol{List-style:None;}7 a{Color:Black;text-decoration:None;}8 a:hover9{text-decoration:Underline;}Ten . Floatleft{float: Left;padding:. 5em. 5em. 5em 0;} One . Floatright{float: Right;padding:. 5em 0.5em. 5em;}

This method is suitable for most web page designs.


The Third Way
Some people seek to completely erase the browser influence

1 html, body, Div, span, applet, object, IFRAME,2 H1, H2, H3, H4, H5, H6, p, blockquote, Pre,3 A, ABBR, acronym, address, big, cite, code,4 del, DFN, EM, Font, IMG, ins, KBD, Q, S, Samp,5 small, strike, strong, sub, SUP, TT, VAR,6 b, U, I, center,7 DL, DT, DD, OL, UL, Li,8 fieldset, form, label, legend,9 table, Caption, Tbody, TFOOT, THEAD, tr, TH, TD{Ten margin:0; One padding:0; A Border:0; - Outline:0; - font-size:100%; the vertical-align:Baseline; - background:Transparent; -} - Body{Line-height:1;} + OL, UL{List-style:None;} - blockquote, Q{Quotes:None;} + Blockquote:before, Blockquote:after, A Q:before, Q:after{content:"';content:None;} at  - /*Remember to define focus styles!*/ - : Focus{Outline:0;} -  - /*Remember to highlight inserts somehow!*/ - ins{text-decoration:None;} in del{text-decoration:Line-through;} -  to /*tables still need ' cellspacing= "0" ' in the markup*/ + Table{Border-collapse:collapse;border-spacing:0;}

Fourth Way
And today Sofish mentioned the Yahoo Yui provided by the CSS reset file

1 BODY,DIV,DL,DT,DD,UL,OL,LI,H1,H2,H3,H4,H5,H6,PRE,FORM,FIELDSET,INPUT,TEXTAREA,P,BLOCKQUOTE,TH,TD{2 margin:0;3 padding:0;4}5 Table{Border-collapse:collapse;border-spacing:0;}6 fieldset,img{Border:0;}7 Address,caption,cite,code,dfn,em,strong,th,var{Font-style:Normal;8 Font-weight:Normal;}9 Ol,ul{List-style:None;}Ten caption,th{text-align: Left;} One H1,h2,h3,h4,h5,h6{font-size:100%;Font-weight:Normal;} A Q:before,q:after{content:"';} - abbr,acronym{Border:0;}

These, no who good who bad one point, most designers do not recommend the first method, because China's plagiarism virtue, now search for CSS web design skills, the first one must be this.

Transfer from watercress: http://www.douban.com/note/330400235/

Web design: Resetting CSS style sheets

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.