CSS Reset Small Note

Source: Internet
Author: User

Reset CSS as a rookie I first found that the browser will default to the elements such as p to set the margin feel the mood just want to discover the new world I understand the need for the following code

*{            margin:0;            padding:0;  }

In fact, this is not a good way to set up, of course you've seen such settings

h1,h2,h3,p,div {            margin:0;            padding:0;        }        

You review elements in the browser find div default margin padding is 0 such settings are not reasonable

Besides, you've got the problem of re-rendering when you add a style to the H1 in the above settings. So you might as well use your settings to reduce rendering when you're using it.

For example, you want to use a div under the P

Div p {            margin:0;            padding:0;

font-size:14px; }

This reduces rendering while also reducing the size of the CSS

In the process of learning this problem, I still refer to a Daniel's blog http://www.zhangxinxu.com/wordpress/?p=758 His other articles write CSS is emotional, It's going to add your personal feelings to the way you write. I suddenly feel that the world of CSS is really wonderful and novel.

CSS Reset Small Note

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.