11.5. HTML element

发布时间 : 2025-10-25 13:33:13 UTC      

Page Views: 9 views

The HTML document is defined by the HTML element.

11.5.1. HTML element

Start label

Element content

End tag

< p >

This is a paragraph.

< / p >

< a href= “default.htm” >

This is a link.

< / a >

< br >

New line

The \* start tag is often referred to as the start tagand the end tag is often referred to as the closing tag.

11.5.2. HTML element syntax

  • The HTML element starts with the opening tag

  • The HTML element terminates with the closing tag

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

  • Some HTML elements have empty content

  • The empty element is closed in the start tag (ends with the end of the starttag)

  • Most HTML elements can have attributes

Note: you will learn more about attributes in the next chapter of this tutorial.

11.5.3. Nested HTML elements

Most HTML elements can be nested (HTML elements can contain other HTML elements).

HTML documents are made up of HTML elements that are nested within each other.

11.5.4. HTML document instance

   

This is the first paragraph.

The above example contains three HTML elements.

11.5.5. Analysis of HTML instance

< p > element:

<p>This is the first paragraph.p>    

This

element defines a paragraph in the HTML document.

This element has a start tag

and a closing tag .

The element content is: this is the first paragraph.

elements:

<body> <p>This is the first paragraph.p> body>    

The element defines the body of the HTML document.

This element has a start tag and a closing tag .

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

elements:

<html> <body> <p>This is the first paragraph.p> body> html>    

element defines the entire HTML documents.

This element has a start tag and a closing tag .

The content of the element is another HTML element ( body element).

11.5.6. Don’t forget the closing tag.

Even if you forget to use the closing tag, most browsers will display it correctly HTML :

<p>This is a paragraph <p>This is a paragraph 

The above examples can also be displayed normally in the browser, because the closing tab is optional.

But don’t rely on it. Forgetting to use the closing tag can produce unpredictable results or errors.

11.5.7. HTML empty element

A HTML element with no content is called an empty element. The empty elementis closed in the opening tag.


is an empty element that does not close the tag
labeldefines a line break).

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

Add a slash to the opening tag, such as
is the right way to closeempty elements, which are accepted by HTML, XHTML, and XML

even if
is valid in all browsers, but use the
. In fact, it is a longer-term protection.

11.5.8. HTML hint: use lowercase tags

The HTML tag is case-insensitive:

equivalent to

. Many websites use uppercase HTML tags.

Rookie tutorials use lowercase tags because the World wide Web Consortium (W3C) recommends lowercase in HTML 4 and enforces lowercase in future (X) HTML versions.

《地理信息系统原理、技术与方法》  97

最近几年来,地理信息系统无论是在理论上还是应用上都处在一个飞速发展的阶段。 GIS被应用于多个领域的建模和决策支持,如城市管理、区划、环境整治等等,地理信息成为信息时代重要的组成部分之一; “数字地球”概念的提出,更进一步推动了作为其技术支撑的GIS的发展。 与此同时,一些学者致力于相关的理论研究,如空间感知、空间数据误差、空间关系的形式化等等。 这恰好说明了地理信息系统作为应用技术和学科的两个方面,并且这两个方面构成了相互促进的发展过程。