Web Front End Learning (2): Start writing HTML

Source: Internet
Author: User
Tags closing tag

in the first chapter, we have a preliminary understanding of the process of surfing the Internet, but also understand the so-called Web page, which is essentially a document written in the HTML language. Believe that most people before the HTML file, the first contact is the use of "Notepad" written by the document or using the Office software "Word" built documents, as a beginner's mind you may ask, HTML documents and these documents are different? Before answering this question, let's try to create these three kinds of documents.

Create the familiar. txt file, open it, and try to enter the text "Learning and Time Learning":

 Create a. docx file, open and enter text content "Learning and Time Learning":

  

OK, now let's create the--html document for today's protagonist. Try to change the suffix name of the Notepad document and Word document to "HTML":

 You'll find they look exactly the same, so let's open it up and try it:

Notepad document

 

Word Document

 We can change the file type by the suffix name, and when we change the suffix to "html", we have actually created the "HTML document". But after changing the name of the document suffix, we found that there was a different situation. When we change a document with the suffix "txt" to "HTML", double-clicking the Open text content will still display correctly, but why does the Word document suffix "docx" be changed to "HTML" after double-clicking the document to display a large garbled. People who have used word should understand that word text is formatted text, that is, we can not only enter text, but also by default the text has its own format, such as font line spacing, etc. (of course, we can also actively set the text content format). Obviously, word text differs from the "Notepad" document and the "HTML" document--we usually make text-formatted documents of word "Rich text", and the remainder is called "Plain text." Because the Word document also contains data about the format, the suffix is changed to "HTML", the data is difficult to interpret, and eventually garbled.

From the above we can know that HTML documents are plain text documents. Next, I will briefly describe the main structure of the HTML document, let's try to write a simple HTML page!

< HTML > < Head > </ Head > < Body > </ Body > </ HTML >

For example, the entire HTML document is actually divided into three parts, including the

When we change the Notepad document to an HTML document, we open the document and we find that the contents of the document can be displayed, so if we want to display the same text in the HTML language, where do we write it? In the literal sense, the content part of the document should be the torso of this page, so we will write the main document part to the <body> department, such as code and.

< HTML > < Head > </ Head > < Body > Learn and Shizhi </ Body > </ HTML >

  So when we want to explain something that is not part of the document but has information about the page, it's time to write it in the head. Let's try introducing <title> tags in the

<HTML><Head>   <title>Time Learning</title> </Head><Body>Learn and Shizhi</Body></HTML>

  and contrast, the only difference is that the title of the page has changed. At this point we did not change the document content of the webpage, but by writing <title> in

Today we started to touch HTML documents and tried the HTML language to write our own Web pages, and we also learned about tags. Learning the Web front end, first we want to learn Hypertext Markup Language (HTML), which means that we will encounter more tags later, and when we grasp more, we will understand the HTML more deeply, but also hope that you and I, in accordance with certain rules to experience a little "design sense" of fun.

Web Front End Learning (2): Start writing HTML

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.