What is an HTML file? An initial understanding of HTML files

Source: Internet
Author: User
Tags closing tag
This is a HTML5 introductory tutorial, in order to let more beginners find the right direction, so this article is about how to learn the system of beginners HTML5.

1. What is an HTML file?

Tml's English name is hypertext Marked Language, Chinese is called "Hypertext Markup Language".

Unlike the general text, an HTML file contains not only textual content, but also some tags, which are called "tokens" in Chinese.

The suffix name of an HTML file is. htm or. html.

You can write HTML files with a text editor.

2. Write an HTML file

Tml's English name is hypertext Marked Language, Chinese is called "Hypertext Markup Language".

Unlike the general text, an HTML file contains not only textual content, but also some tags, which are called "tokens" in Chinese.

The suffix name of an HTML file is. htm or. html.

You can write HTML files with a text editor.


To browse this first.html file, double-click it. or open a browser, select Open on the File menu, and select the document.

The first tag of this file is

The content between

The content between <title> and </title> is the title of this file. You can see this title in the title bar at the top of the browser.

The information between <body> and </body> is the text.

The text between <b> and </b> is indicated in bold. <b>, as the name implies, is the meaning of bold.

The HTML file looks similar to the normal text, but it has more tags than the normal text, such as

HTML element (HTML Elements)

HTML elements (HTML element) are used to mark text, which represents the content of the text. For example, Body, p, title is the HTML element.

The HTML element is tagged with tag, and tag starts with < and ends with >.

Tags are usually in pairs, such as <body></body>. The beginning is called opening tag, and the end is called closing tag.

The tag of the current HTML is not case-sensitive. For example,

Attributes of HTML elements (HTML Elements)

HTML elements can have properties. Properties can extend the ability of HTML elements.

For example, you can use a bgcolor property to make the background color of a page red, like this:

<body bgcolor= "Red" >

For example, you can use the Border property to set a table as a borderless table. As follows:

<table border= "0" >

Properties are usually paired with property names and values, like this: Name= "value". In the above example bgcolor, border is name,red and 0 is value. Property values are generally marked in double quotation marks. The opening property is usually appended to the HTML tag, not the closing tag.

Body Title

This example shows you how to define a body header in an HTML file.

HTML uses


Paragraph Division

Use <p> and </p> to divide paragraphs in HTML.

<p>this is a paragraph</p><p>this is another paragraph</p>

Line break

By using the <br> tag, you can wrap a line without creating a new paragraph. <br> no closing Tag. Using <p> wrapping is a bad habit, and the right thing to do is use <br>.

<p>this<br>is a para<br>graph with line breaks</p>

HTML annotations

In the HTML file, you can write code comments explaining your code, which will help you and others to better understand your code in the future.

Comments can be written between <!--and. The browser ignores comments, and you don't see your comments in the HTML body.

<!--This is a comment-

Some small suggestions

The HTML file will automatically truncate the extra spaces. No matter how many spaces you add, it's considered a space. A blank line is also considered a space.

Some tags can make text into a paragraph without having to use <p></p> to segment it. such as the title tag

"Recommended"

The development history of HTML and HTML5

HTML base element that gives you 0 basic learning HTML

Related Article

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.