CSS reset style sheet, css style sheet

Source: Internet
Author: User

CSS reset style sheet, css style sheet

I. Why do I need to reset the style sheet?

Even if you do not write CSS styles, HTML tags also have styles in the browser. These styles come from the browser itself. But the problem is that different browsers may have different default styles. CSS resets the style sheet to solve this problem.


Ii. Frequently Used style sheet resetting

(1) simple violence

Only one row:

* {Margin: 0; padding: 0 ;}
The wildcard "*" matches all tags and is generally considered to be of poor performance.


(2) return to zero

Almost all labels are cleared. For example, reset a style sheet for YUI (http://yuilibrary.com.


(3) retain the basic style

Instead of clearing the default style of all labels, the original style of the label is retained based on the unified style of Each browser. For example: normalize.css (https://github.com/necolas/normalize.css)


(4) custom type

Custom reset styles should be the best, and you can reset the styles of tags if you use them. However, we do not know which labels will be used by others after the project is transplanted or when many people work together. For convenience, we usually use the type (2) or (3) to reset the style sheet.

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.