CSS Reset Method

Source: Internet
Author: User

CSS Reset resets the browser's style. 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.

You are using CSS, have you ever used CSS reset? Of course, you may use it, but you don't know it is being used, for example, you might use:

* {padding:0;     margin:0;     border:0; }

This is also a CSS reset method, so that all selectors of the padding, margin and border are set to 0. This is a powerful method, but also the simplest and safest method, however,

is also the most resource-intensive approach. For small sites, this does not bring a huge waste of resources, but if it is a very large architecture like Yahoo!, just need to selectively CSS reset,

To reduce the waste of resources. Here is Yahoo's CSS reset code, is also the most popular CSS reset method, Yui selected method is:

Body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre, form,fieldset,input,textarea,p,blockquote,th,td {padding:0; margin:0; } table {border-collapse:collapse; border-spacing:0;} fieldset,img {border:0;} address,caption,cite,code,dfn,em,str Ong,th,var {font-weight:normal; font-style:normal;} ol,ul {list-style:none;} caption,th {text-align:left;} h1,h2 , H3,h4,h5,h6 {font-weight:normal; font-size:100%;} q:before,q:after {content: ';} abbr,acronym {border:0;}

OK, I believe you have also understood the purpose of the CSS reset, perhaps you can also according to their own preferences, write a CSS reset system, after all, the needs and habits of different.

Reprint http://www.nowamagic.net/librarys/veda/detail/732

CSS Reset Method

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.