Compatible, originally started here -------- Day34

Source: Internet
Author: User

After reading the javascript code for the w3cschool for two days, I browsed the javascript part of w3cschool. I had a concept in my mind, and I realized that when I entered the river, the lake was like a sea, the road to poverty is difficult. At least it seems to be far away, too many don't understand, too many are at a loss, but it is good, it is no longer a bad ah, any direction to go is uphill, in this case, let's go...


Digress: (personal learning records)

The ECMAscript + DOM + BOM of javascript... can be summarized in one sentence: control its shape and communicate with it.

Some subjects that may need to be studied: Closure/js operations cookie/browser difference/compatibility Implementation/rendering, etc. Come on, don't dare to be too far away, Lu Yao knows the "code" force, come on .....


Let's get down to the truth. Let's talk about what we want to record today:Reset.cssFrom this point of view, I don't know whether the people I see are actually the ones on the page, but also the ones I want to talk about are reset.css.

1. What is it?

In fact, I personally feel it is difficult to give it a professional definition. More should be a kind of conceptual understanding. What we need to know first is a helpless reality, different browsers have different default styles. Therefore, different feedback effects may occur when you write the same code in different browsers, we must also be aware of the second more helpless reality. We cannot ask our users to use a browser, which violates our original intention: Ghost.

Principle: overwrite the affiliated style of the browser with the execution sequence and priority of css.

2. Those Years

The following code is provided. I believe most people are familiar with it.

*{margin:0;padding:0;}
Some people say that its learning name is actually global white space reset, which is in the original state. If reset.css is used to paste the wallpaper and beautify the room, this sentence will suddenly let us go back to years ago, it breaks everything apart, as if returning to the beginning that only has a blank, not broken, as if to see that Alexander waved to the closed edge, arrogant but effective ....

Its degree of cleaning is amazing, but it is too far behind. Its impact on rendering performance and the indispensable style setting make it gradually fade out of people's implementations, although it was a legend that surprised me ....

3. Usage principles

There will never be a method that can be used once and for all, just like a solution that will never be able to do anything. In the future, we will try to use the example reset.css to add it in a long programming career. If you have no experience, you will not be able to play it, however, after all, there are several indispensable points:

A. Minimize the frequency of "copying" and "pasting" to ensure a low code repetition rate;

BITs do not need to be directly downloaded and used to compile the corresponding reset.css;

Csung is sure to understand every sentence in reset.css.

D. Don't bother, like *{}


In general, let's write this. In fact, simply put, it is to bring all browsers back to their original state (all browser styles are overwritten), and then start building a new one a little bit.



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.