The following are some of my own thoughts and gains. Due to my shallow personal knowledge, if there is something wrong or inaccurate, please criticize and correct me.
The three musketeers of front-end development, HTML, CSS, and JS, are well-known and are the basis for getting started with the front-end. Front-end programmers use these three components to form a large number of web pages. However, when you first learn, because you cannot quickly understand all the knowledge points, you often feel like a blind person trying to grasp the elephant when learning - that is, you do not know much about the functions and division of labor of each component, and you cannot grasp the direction of learning as a whole, so it is difficult. Forming a complete knowledge system is a headache. I have a characteristic in learning. I like to start from the bottom knowledge, and then add other content layer by layer on this basis, and finally form a complete framework. This is the way I'm used to learning.
At the beginning, I was still a little dizzy. The knowledge points were one after another, and they also overlapped with each other. The front was connected to the back, and the back was connected to the front. It still took a lot of effort to understand. But after reading the entire content two or three times, the entire framework becomes much clearer. Simply put, the division of labor in HTML, CSS, and JS embodies the concept of software layering. The general function distribution is: HTML is responsible for describing content, CSS is responsible for describing the style of elements, and JS is responsible for implementing the actions of the web page. In this way, it is actually not clear enough. Newbies can’t quite understand it. I think we can understand why there are these three divisions from the development process of web pages.
Early web pages were static web pages, and the elements in the web pages basically had no action. People went online mainly to browse information, and the interactivity requirements for web pages were also low. We can take a look at Yahoo's website in 1996 (the picture is taken from the Internet). There are pictures, hyperlinks and search boxes on the web page. Most of them use the default style. Such web page style and content are mixed together. If you want to modify the style of the web page , you need to modify them one by one, which will be more troublesome. So how to solve this problem? The pioneers of web development separated the style from the content and combined all the statements describing the style of the web page into one file. This file is called a cascading style sheet, or CSS for short. If we want to modify the style, we can modify it from this file. Through some selectors, we can quickly change the style of a certain element or a certain type of element, thus improving efficiency.
After removing the style from the web page, the HTML language is only responsible for describing the content of the web page. What does this mean? In HTML, we use the
element to mark the header file, the