What is the Internet

The code is developed locally, uploaded to a server for everyone to access, and when you have more services and more people accessing them, you have the Internet.

The HTTP protocol

Hypertext Transfer Protocol (HTTP) is a common protocol for data transmission over the Internet.

Front end and back end

The common way to access the Internet is through the browser. The browser initiates a request to the server, and the server returns data for rendering by the browser. The development of server-related functions is the back end, and the development of browser-related functions is the front end. (Although the front end covers a wide range of topics, it is essentially browser-based development.)

Develop a web page

Create a folder, open it with the VSCODE editor, create an index. HTML file, and type! (Exclamation mark in English mode), press TAB to automatically generate the HTML5 skeleton

How to browse the Web

Install the LiveServer plug-in in VSCODE. After the installation is complete, right-click “Open With LiveServer” to Open the browser and display the web page

Learn about the HTML5 skeleton

HTML is made up of tag pairs, and HTML5 is the latest specification for HTML.

<! DOCTYPEhtml>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="Width = device - width, initial - scale = 1.0" />
    <title>Document</title>
  </head>
  <body></body>
</html>
Copy the code

is a Document Type Declaration DTD

< HTML lang=”en”>
is an HTML tag pair, and lang=”en” is an HTML attribute that represents the language of the web page

is the head tag pair that contains the configuration of the page

is the body tag pair that contains the content of the web page

Character set

Set the character set of the web page. Charset is the attribute name that represents the character set. Utf-8 is an attribute value that represents a character set.

Utf-8 is actually a character encoding based on the Unicode character set, which has other encodings such as UTF16.

The page title

Document Sets the title of the web page, that is, the content on the browser TAB bar. Title is also the title of the search engine included site display, in order to attract users, reasonable setting of title is necessary.

Know the label

HTML is called hypertext Markup Language, and “hypertext markup” is the tag, and different tags have different functions.

Tags usually come in pairs. For example, in the < P > front

,

is the start tag,

is the end tag, and the P tag represents a piece of text. Similarly, the < H1 > header represents a first-level header.

Some tags are not paired, but have only one start tag, called a single tag.


The title tag

H series labels represent the semantic meaning of headings and are divided into H1 ~ H6 according to weight, such as < H1 > first-level headings
and < H2 > second-level headings
. H1 tags are very important to search engines and should be placed in

.

Only one H1 tag can be placed. Otherwise, the operating system considers the H1 tag as cheating.

Paragraph tags

is a paragraph tag that contains a paragraph of text.

Div tags

The

tag is the most common tag in HTML and is used to put related content together to build the layout of a web page. A div tag is like a container in which you can put anything, often called a “box.”

HTML 5 features

Blank folding

Multiple Spaces or line breaks between text are merged into a single space

Escape character

If we wanted to show that we learned the

tag today, if we wrote it directly, it would look like this

Browsers do not display tags, only as semantic identifiers, so we need to write them with special conjunctions, which are escape characters.

Common escape characters include:

  • &lt;Less than no.
  • &gt;More than no.
  • &nbsp;Spaces (this way writing Spaces will not be folded)
  • &copy;Copyright ©

So the sentence above should read: Today I learned < p> < /p> The label.

HTML comments

Comments are used to explain the meaning of the code and help readers better understand the code. Comments are written in the format