A website refers to a collection of web pages produced using HTML and other content on the Internet according to certain rules to display specific content.
A web page is a "page" in a website. Usually a file in HTML format, which is read by a browser.
A web page is actually a file placed on the server. When we browse the web page, this file will be downloaded to our local computer, and then parsed by the browser to render various beautiful interfaces, such as tables, pictures, titles, List etc.
There are many suffixes for web page files, such as .html, .php, .jsp, .asp, etc. I believe readers have seen them in the address bar of the browser, as shown in the following figure:
The URL can be viewed in the browser address bar
But no matter what the suffix of the web page is, its essence is the same, which is a plain text file composed of HTML code.
We can use text editors such as Notepad, Notepad++, Sublime Text, and Vim to open the web page file and see all its contents, just like the following:
<!DOCTYPEhtml><html><head><metacharset=UTF-8><title>This position is the title of the web page</title></head><body><p>This position is the content text of the web page</p ><ahref=http://dotcpp.com/>This location is a hyperlink</a><ul><li>Project 1</li><li>Project 2</li><li>Project 3< /li></ul></body></html>
This is the HTML code! We can see many special tags surrounded by <>, which are called HTML tags. The browser renders various interfaces and effects by recognizing these HTML tags.
Save the above code to index.html, drag it to the browser and run it (or double-click the file), you can see the following effect:
This is a very simple and basic web page. It is only used as an example to demonstrate. The HTML code of a real web page is much more complicated than this. You can right-click on the web page and select "View web page source code" in the pop-up menu. You can view the HTML code of the current web page.
Web pages are identified and accessed through a website address (URL). When we enter the URL in the web browser, after a complex and fast process, the web page file will be transferred to the user's home computer, and then the content of the web page will be interpreted through the browser. , and then display it to the user.
1. Web page: Simply speaking, from a user perspective, it is the things you see, such as Taobao, C language network, etc.
2. Files: We all know that files exist in computers. The picture below can show you where these files are. Of course, it is just an example.
● On the server side
This is a tomcat server under Windows, and the web pages you browse are saved in the webapps folder.
●On the browser side
The browser is actually a parser, which mainly parses HTTP files, CSS files and JS files sent from the server.
It's actually very simple. Web pages are just files.
3. Computer: As the name suggests, a computer is a server on the server side. What does a server look like? The picture below is the server, you can take a look.
4. Website address (URL):
5. Complex and fast programs: When the web page file is sent, it will be processed by these programs.
6. Browser: The browser interprets the three received files through the kernel in the browser, renders them into the web pages we see, and then displays them to the user.
7. Summarized into a picture:
If you want to understand the structure of a web page, you must first understand the W3C organization.
World Wide Web Consortium (W3C), also known as the W3C Council. Founded in October 1994 at the MIT Computer Science Laboratory. Founded by Tim Berners-Lee, the inventor of the Internet.
Almost all standards for web pages are made by this alliance. According to its standard web page standards, HTML is the basis, CSS files are responsible for beautification, and JS is responsible for interactions and actions.
This is a simple DOM tree. Our network resources can be regarded as each apple on the tree. Organizing resources in this way will greatly improve the browser's parsing speed. Our family relationships in daily life can be clearly displayed through such a picture.