英文链接 源链接 [23628]
contenteditable="true"

HTML - Overview 介绍

HTML代表 H yper t ext M arkup L 语言,它是编写网页的最广泛使用的语言。

  • 超文本是指将网页(HTML文档)链接在一起的方式。因此,网页上可用的链接称为超文本。

  • 顾名思义,HTML是一种标记语言,这意味着您可以使用HTML来简单地"标记"带有标记的文本文档,该标记告诉Web浏览器如何将其构造为显示。

最初,HTML的开发旨在定义标题,段落,列表等文档的结构,以促进研究人员之间共享科学信息。

现在,借助于HTML语言中可用的不同标签,HTML被广泛用于格式化网页。

基本HTML文档

以最简单的形式,下面是一个HTML文档的示例-

<!DOCTYPE html>
<html>

   <head>
      <title>This is document title</title>
   </head>
	
   <body>
      <h1>This is a heading</h1>
      <p>Document content goes here.....</p>
   </body>
	
</html>

HTML标签

As told earlier, HTML is a markup language and makes use of various tags to format the content. These tags are enclosed within angle braces <Tag Name>. Except few tags, most of the tags have their corresponding closing tags. For example, <html> has its closing tag </html> and <body> tag has its closing tag </body> tag etc.

上面的HTML文档示例使用以下标签-

Sr.No Tag & Description
1 <!DOCTYPE...>

此标记定义文档类型和HTML版本。

2 <html>

This tag encloses the complete HTML document and mainly comprises of document header which is represented by <head>...</head> and document body which is represented by <body>...</body> tags.

3 <head>

This tag represents the document's header which can keep other HTML tags like <title>, <link> etc.

4 <title>

The <title> tag is used inside the <head> tag to mention the document title.

5 <body>

This tag represents the document's body which keeps other HTML tags like <h1>, <div>, <p> etc.

6 <h1>

此标记表示标题。

7 <p>

此标记代表一个段落。

要学习HTML,您需要在格式化文本文档时研究各种标签并了解它们的行为。学习HTML很简单,因为用户必须学习不同标签的用法才能对文本或图像进行格式化,从而制作出精美的网页。

万维网联盟(W3C)建议使用从HTML 4开始的小写标签。

HTML文档结构

典型的HTML文档将具有以下结构-

<html>
   
   <head>
      Document header related tags
   </head>
   
   <body>
      Document body related tags
   </body>
   
</html>

我们将在随后的章节中研究所有标题和正文标签,但是现在让我们看看什么是文档声明标签。

The <!DOCTYPE> Declaration

The <!DOCTYPE> declaration tag is used by the web browser to understand the version of the HTML used in the document. Current version of HTML is 5 and it makes use of the following declaration −

<!DOCTYPE html>

There are many other declaration types which can be used in HTML document depending on what version of HTML is being used. We will see more details on this while discussing <!DOCTYPE...> tag along with other HTML tags.

点我分享笔记