Internet Technologies 简明教程
HTML
Introduction
HTML 代表 Hyper Text Markup Language. 。它是一种格式化语言,用于定义网页的外观和内容。它允许我们在网页上组织文本、图形、音频和视频。
HTML stands for Hyper Text Markup Language. It is a formatting language used to define the appearance and contents of a web page. It allows us to organize text, graphics, audio, and video on a web page.
Key Points:
Key Points:
-
The word Hypertext refers to the text which acts as a link.
-
The word markup refers to the symbols that are used to define structure of the text. The markup symbols tells the browser how to display the text and are often called tags.
-
The word Language refers to the syntax that is similar to any other language.
HTML Tags
Tag 是命令,它告诉网络浏览器如何在网页上显示文本、音频、图形或视频。
Tag is a command that tells the web browser how to display the text, audio, graphics or video on a web page.
Key Points:
Key Points:
-
Tags are indicated with pair of angle brackets.
-
They start with a less than (<) character and end with a greater than (>) character.
-
The tag name is specified between the angle brackets.
-
Most of the tags usually occur in pair: the start tag and the closing tag.
-
The start tag is simply the tag name is enclosed in angle bracket whereas the closing tag is specified including a forward slash (/).
-
Some tags are the empty i.e. they don’t have the closing tag.
-
Tags are not case sensitive.
-
The starting and closing tag name must be the same. For example <b> hello </i> is invalid as both are different.
-
If you don’t specify the angle brackets (<>) for a tag, the browser will treat the tag name as a simple text.
-
The tag can also have attributes to provide additional information about the tag to the browser.
Basic tags
下表显示了定义基本网页的基本 HTML 标签:
The following table shows the Basic HTML tags that define the basic web page:
Tag |
Description |
<html> </html> |
Specifies the document as a web page. |
<head> </head> |
Specifies the descriptive information about the web documents. |
<title> </title> |
Specifies the title of the web page. |
<body> </body> |
Specifies the body of a web document. |
以下代码显示了如何使用基本标签。
The following code shows how to use basic tags.
<html>
<head> Heading goes here…</head>
<title> Title goes here…</title>
<body> Body goes here…</body>
</html>
Formatting Tags
下表显示了用于设置文本格式的 HTML 标签:
The following table shows the HTML tags used for formatting the text:
Tag |
Description |
<b> </b> |
Specifies the text as bold. Eg. this is bold text |
<em> </em> |
It is a phrase text. It specifies the emphasized text. Eg. Emphasized text |
<strong> </strong> |
It is a phrase tag. It specifies an important text. Eg. * this is strong text* |
<i> </i> |
The content of italic tag is displayed in italic. Eg. Italic text |
<sub> </sub> |
Specifies the subscripted text. Eg. X1 |
<sup> </sup> |
Defines the superscripted text. Eg. X2 |
<ins> </ins> |
Specifies the inserted text. Eg. The price of pen is now 2015. |
<del> </del> |
Specifies the deleted text. Eg. The price of pen is now 2015. |
<mark> </mark> |
Specifies the marked text. Eg. It is raining |
Table Tags
下表描述了常用的表格标记:
Following table describe the commonaly used table tags:
Tag |
Description |
<table> </table> |
Specifies a table. |
<tr> </tr> |
Specifies a row in the table. |
<th> </th> |
Specifies header cell in the table. |
<td> </td> |
Specifies the data in an cell of the table. |
<caption> </caption> |
Specifies the table caption. |
<colgroup> </colgroup> |
Specifies a group of columns in a table for formatting. |
List tags
下表描述了常用的列表标记:
Following table describe the commonaly used list tags:
Tag |
Description |
<ul> </ul> |
Specifies an unordered list. |
<ol> </ol> |
Specifies an ordered list. |
<li> </li> |
Specifies a list item. |
<dl> </dl> |
Specifies a description list. |
<dt> </dt> |
Specifies the term in a description list. |
<dd> </dd> |
Specifies description of term in a description list. |
Frames
{@s0} 帮助我们将浏览器的窗口划分为多个矩形区域。每个区域包含单独的 HTML 网页,并且它们每个都独立工作。
Frames help us to divide the browser’s window into multiple rectangular regions. Each region contains separate html web page and each of them work independently.
下表描述了用于创建框架的各种标记:
The following table describes the various tags used for creating frames:
Tag |
Description |
<frameset> </frameset> |
It is replacement of the <body> tag. It doesn’t contain the tags that are normally used in <body> element; instead it contains the <frame> element used to add each frame. |
<frame> </frame> |
Specifies the content of different frames in a web page. |
<base> </base> |
It is used to set the default target frame in any page that contains links whose contents are displayed in another frame. |
Forms
{@s1} 用于输入值。这些值被发送到服务器进行处理。表单使用输入元素(如文本字段、复选框、单选按钮、列表、提交按钮等)在其中输入数据。
Forms are used to input the values. These values are sent to the server for processing. Forms uses input elements such as text fields, check boxes, radio buttons, lists, submit buttons etc. to enter the data into it.
下表描述了创建表单时常用的标记:
The following table describes the commonly used tags while creating a form:
Tag |
Description |
<form> </form> |
It is used to create HTML form. |
<input> </input> |
Specifies the input field. |
<textarea> </textarea> |
Specifies a text area control that allows to enter multi-line text. |
<label> </label> |
Specifies the label for an input element. |