CSS Reset (CSS resets)

Source: Internet
Author: User

CSS reset refers to the style of resetting the browser. In various browsers, the CSS selector will default some values, such as when the H1 is not set to a value, display a certain size.

But not all browsers use the same values, so CSS Reset is used to make the style of the Web page consistent across browsers.

Here are a few of the main CSS reset codes:

1. Eric Meyer

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, 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, Article, aside, canvas, details, embed, figure, figcaption, footer, Header, Hgroup, menu, nav, output, Ruby, S Ection, summary, time, mark, audio, video {margin:0; padding:0; border:0; Font-size: -%;  Font:inherit; Vertical-Align:baseline; }/*HTML5 display-role reset for older browsers*/article, aside, details, figcaption, figure, Footer, Header, Hgroup, menu, nav, section {display:block; } body { line-height:1; } OL, ul {list-Style:none;  } blockquote, q {quotes:none; } Blockquote:before, Blockquote:after, Q:before, q:after {content:"';  Content:none; } Table {Border-Collapse:collapse; Border-spacing:0; }

2, YUI

  

/*YUI 3.4.1 (build 4118) Copyright: Yahoo! Inc.  All rights reserved.  Licensed under the BSD License. http://yuilibrary.com/license/    */    /*TODO'll need to remove settings on HTML since we can ' t namespace it.  TODO with the Prefix,should I Group by selector or property for weight savings? */HTML {color:# the;  Background: #FFF; }/*TODO Remove settings on BODY since we can ' t namespace it. */    /*TODO Test putting a class on HEAD.  -Fails on FF. */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; } Table {Border-Collapse:collapse; Border-spacing:0; } fieldset,img {border:0; }/*TODO Think about hanlding inheritence Differently,maybe letting IE6 fail a bit ...*/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: -%; Font-Weight:normal; } q:before,q:after {content:"'; } abbr,acronym {border:0; Font-Variant:normal; }/*To preserve Line-height and selector appearance*/sup {Vertical-align:text-top; } SUB {vertical-align:text-Bottom; } Input,textarea,Select{font-Family:inherit; Font-Size:inherit; Font-Weight:inherit; }/*To enable resizing for IE*/Input,textarea,Select{*font-size: -%; }/*because legend doesn ' t inherit in IE*/Legend {color:# the; }

3, Csslab

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, Font, IMG, INS, KBD, Q, S, Samp, small, strike, Sub, SUP, TT,var, DL, DT, DD, OL, UL, Li, FieldSet, form, label, legend, table, Caption, Tbody, TFOOT, THEAD, tr, TH, TD, Article, as IDE, dialog, figure, Header, Footer, Hgroup, menu, nav, section, time, Mark, audio, video {margin:0; padding:0; border:0; Outline:0; Font-Weight:inherit; Font-Style:inherit; Font-size: -%;  } article, aside, NAV, section, dialog, figure, Header, footer, Hgroup {display:block;  } legend {Display:none; }: Focus {outline:0; } Table {Border-Collapse:collapse; Border-spacing:0; } caption, Th, td {Text-Align:left; Font-Weight:normal;  } a img, iframe {border:none; } UL {List-Style:none; } input, textarea,Select, button {font-size: -%; Font-Family:inherit; } input,Select{Vertical-Align:middle; }Select{margin:inherit; } button {border:0; padding:0;  Background:transparent;  Cursor:pointer; }/*Fixes Incorrect placement of numbers in Ol ' s in IE6/7*/ol {margin-Left:2em;} /*========================================= Clearfix = =*/. clearfix:after {content:".";  Display:block; Height:0;  Clear:both;  Visibility:hidden; }. clearfix {display:inline-Block;} * HTML. clearfix {height:1%;} . clearfix {display:block;}

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.