HTML Basics Tutorial (2)--html elements

Source: Internet
Author: User

HTML documents are text files that are composed of HTML elements.

HTML elements are defined by using HTML tags.

HTML Tags
  • HTML tags are used to tag HTML elements .
  • HTML tags are surrounded by < and > symbols , which are called angle brackets.
  • HTML tags appear in pairs . such as <b> and </b>.
  • The text that is between the start and end tags is the content of the element.
  • The HTML tag is not sensitive to case ,<b> and the role of <B> is the same.

HTML elements

Do you remember the example in the previous section:

<HTML><Head><title>Title of the page</title></Head><Body><P>This is my first page.</P><b>This text is in bold.</b></Body></HTML>

This is an HTML element:

< b > This text is bold. </ b >

This HTML element starts with the start tag <b> .

The content of this element is: "This text is bold. ”。

This HTML element is terminated by the tag </b> end.

The function of the <b> tag is to define an HTML element that is displayed in bold.

This is also an HTML document:

< Body > < P > This is my first page. </ P > < b > This text is bold. </ b > </ Body >

This HTML element starts with the <body> tag and ends with the </body> tag.

The function of the <body> tag is to define the HTML element that holds the body in the HTML file.

Why should we use lowercase tags?

We just talked about: the HTML tag is insensitive to case:<b> and the same as <B> 's role. When you surf the Web, you'll find that most tutorials use uppercase HTML tags in their examples. And we always use lowercase. What is the reason?

If you want to be prepared to use next-generation HTML, you should use lowercase tags. The World Wide Web Consortium has the following criteria: It is recommended to use lowercase tags in html 4, whereas in XHTML (Next generation HTML), lowercase tags must be used.

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.