Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to write the simplest page in HTML

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

Today, I would like to share with you how to use HTML to write the simplest page of the relevant knowledge, detailed content, clear logic, I believe that most people still know too much about this knowledge, so share this article for your reference, I hope you can learn something after reading this article, let's take a look at it.

Understanding the basic structure of HTML

First line

Second line

The third line

Fourth line

The fifth line

The sixth line

The seventh line

The above seven lines of code are the basic structure of the HTML code of a web page file.

If you look at it, you can find a rule. The content of each line is written in "". The reason is a long story, just remember it first. Every content written in "" is called "tag". The word "label" will appear frequently in the future.

The first line tag instructs the web browser about which HTML version of the page to use for writing (this sentence can be understood for the time being). The important thing is that this arrogant code can only exist in the first line of HTML code!

The second line tag is paired with the seventh line tag, "" is called the opening tag, "" is called the closing tag. The difference between them is that the end tag has one more "/" than the start tag. This is an important rule of HTML code, most of the tags I will learn in the future are like this, maybe the browser has some obsessive-compulsive disorder, it will be very uncomfortable if it doesn't end the tag, and it may cause trouble (it doesn't display properly). However, it is a pity that I am so arrogant that there is no other half so far. And tags define the start and end points of the document.

The third and fourth lines are paired, called the "head" tag. As the name implies, the content in this "header" tag dominates the overall situation, such as CSS code files that control layout and style and JavaScript code files that add interactive features are added or imported here; keyword information used in the search page is added here; the encoding method of the page information is also specified; the title of the browser window is also displayed here.

The fifth and sixth lines are paired, called the "body" tag. Used to display all the page content information.

Draw a diagram to show the hierarchical relationship of these four tags (that is, who contains whom, or who appears in whose sphere of influence):

Tools: computer, install a browser (IE Firefox Google browser is fine), make sure the "notepad" tool is available.

With the above tools, we can write.

Step1 create a new .txt file.

Do the following:

(1) Select the appropriate disk, such as D disk or F disk, create a new folder and name it "web page". Click to enter.

(2) right-click in the space to create a new text file and name it "the first page". At this point we have a "first page .txt" file.

If your computer does not display a file suffix such as ".txt", you can look for the View menu at the top left of the screen, as shown in figure 2

Do web pages while learning-get to know HTML for the first time

Figure 2

After clicking, the following menu appears as shown in figure 3, click "options".

Figure 3

Click "View" and remove the "check mark" before the "hide extensions of known file types" option, as shown in figure 4. At this point, you can display or modify the file suffix.

Figure 4

Step2 add content

(1) double-click to open the "first page .txt" file and enter seven lines of code into the basic structure of HTML.

(2) Save, close the file, right-click on the "first page .txt" file, select "rename", and change ".txt" to ".html". At this point, the system will prompt, as in figure 1, boldly "yes".

Figure 1

At this point, our file becomes a html web file.

We double-click the file and find a blank in the browser, which is like putting a plate on the table with no food in it. A piece of white in the browser is the color of the empty disc, and the basic structure of HTML is this dish.

Next, let's add something to the plate.

Step3 add content

(1) right-click on the "first page .html" file, select "Open with", select "notepad", if there is no "notepad" option, click "Select other applications", click to select "more applications" at the bottom, and select "notepad". The next time you choose Open mode, notepad will appear.

(2) add "learn to write the first web page" between the tags. Add "the first web page" between;

As you learn more and more, the web page will become more and more beautiful!

"done as shown in figure 5

Do web pages while learning-get to know HTML for the first time

Figure 5

(3) Save, close, double-click to open! The effect is shown in figure 6.

These are all the contents of the article "how to write the simplest page in HTML". Thank you for reading! I believe you will gain a lot after reading this article. The editor will update different knowledge for you every day. If you want to learn more knowledge, please pay attention to the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report