"HTML Beginner" 1, HTML elements

Source: Internet
Author: User

HTML documents are defined by HTML elements.

The HTML element refers to all the code from the start tag (start tag) to the end tag (end tag);

HTML element Syntax

HTML element starting with start tag

HTML element terminated with end tag

• The content of the element is the content between the start tag and the end tag

• Some HTML elements have blank content (empty contents)

• Empty elements are closed in the start tag (ending with the end of the start tag)

• Most HTML elements can have properties

Nested HTML elements

Most HTML elements can be nested (including other HTML elements)

HTML documents consist of nested HTML elements

==========================================

HTML document Instance

<body>

<p>this is my first paragraph.</p>

</body>

The above example contains three HTML elements.

===========================================

HTML instance Explanation

<p> Elements :

<p>this is my first paragraph.</p>

This <p> element defines a paragraph in an HTML document.

This element has a start tag <p>, and an end tag </p>.

Element contents are: This is my first paragraph.

============================================

<body> Elements :

<body>

<p>this is my first paragraph.</p>

</body>

The <body> element defines the body of the HTML document.

This element has a start tag <body>, and an end tag </body>.

The element content is another HTML element (p element).

=============================================

elements:

<body>

<p>this is my first paragraph.</p>

</body>

The

This element has a start tag

The element content is another HTML element (the BODY element).

===============================================

An empty HTML element

HTML elements that have no content are called empty elements. The empty element is closed in the Start tab.

<br> is the empty element without closing the label (the <br> tag defines a newline).

In XHTML, XML, and future versions of HTML, all elements must be closed.

Adding slashes to the start tag, such as <br/>, is the correct way to close an empty element, which is accepted by HTML, XHTML, and XML.

Even if <br> is valid in all browsers, the use of <br/> is actually a longer term guarantee.

=================================================

HTML Hint: Use lowercase tags

Because learning Android to use XML, XML to master HTML, so, I an electrician again opened the HTML data ...

The above HTML data and the following HTML knowledge are from

Http://www.w3school.com.cn/h.asp

Thanks for all the shared learning resources on the Internet!

"============end============="

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.