清除元素中的子元素html_HTML中的元素简介

清除元素中的子元素html

An element is a fundamental component that is used to develop web pages. Generally an element as two components: a starting tag and a closing tag. The content is added in between the starting and closing tags. The ending tag is the same as the starting the staring tag except that the ending tag precedes with a "/".

元素是用于开发网页的基本组件。 通常, 元素由两个部分组成: 开始标签和结束标签 。 内容添加在开始标记和结束标记之间。 结束标签与起始凝视标签相同,除了结束标签以“ /”开头。

Syntax:

句法:

    <h1 align="right"> A HEADING </h1>

Here,

这里,

  • H1: tag name, starting tag

    H1 :标签名称,起始标签

  • align="right": name and value. It is an attribute

    align =“ right” :名称和值。 这是一个属性

  • A HEADING: Content

    标题 :内容

  • /H1: end tag

    / H1 :结束标签

HTML元素的类型 (Types of the HTML elements)

The elements in the HTML are classified in two types,

HTML中的元素分为两种类型,

1) Container Elements

1)容器元素

These elements have a starting and an ending tag. The content is given in between the tags.

这些元素具有开始和结束标记。 内容在标签之间给出。

Example:

例:

    <b>this element is used for bold text</b>

2) Empty Elements

2)空元素

These elements do not contain an ending tag. They have a starting tag only. These elements are used for performing some specific functions.

这些元素不包含结束标记。 它们仅具有开始标记。 这些元素用于执行某些特定功能。

Exampple:

范例:

    This element is used to give a horizontal rule or say line.
    <hr />

The HTML elements can also be used in a nested form.

HTML元素也可以嵌套形式使用。

    <b> <i> to give BOLD and ITALICS letters </i> </b>

With the nested elements one should careful with the closing tags. That means the inner tags should be closed first then the outer tags. Like in the above example, the <i> tag closed before the <b> tag.

对于嵌套元素,应该注意结束标记。 这意味着应该先关闭内部标签,然后再关闭外部标签。 像上面的示例一样, <i>标记在<b>标记之前关闭。

文本级元素 (TEXT-LEVEL ELEMENTS)

It is also known as inline elements, they affect the appearance of the text in a web-page.

也称为内联元素,它们会影响网页中文本的外观。

It is of two types,

它有两种类型,

1) Physical Elements

1)物理元素

It is also known as the character formatting elements, it specifies the display of the text on the webpage. For example: to highlight or to underline the text in the webpage. Some commonly used elements are BOLD (<b>...</b>), ITALICS (<i>...</i>), UNDERLINE (<u>...</u>), SUPERSCRIPT (<sup>...</sup>), SUBSCRIPT (<sub>...</sub>), and STRIKE (<strike>...</strike>).

也称为字符格式元素,它指定文本在网页上的显示。 例如:突出显示或在网页上加下划线。 一些常用元素包括BOLD( <b> ... </ b> ),ITALICS( <i> ... </ i> ),UNDERLINE( <u> ... </ u> ),SUPERSCRIPT( < sup> ... </ sup> ),SUBSCRIPT( <sub> ... </ sub> )和STRIKE( <strike> ... </ strike> )。

2) Logical Elements

2)逻辑元素

It describes the logical or general description of the webpage. These elements are used to define the structural importance of the text. Some commonly used logical elements are SAMPLE, CODE, CITE, STRONG, EMPHASIS, VARIABLE.

它描述了网页的逻辑或一般描述。 这些元素用于定义文本的结构重要性。 一些常用的逻辑元素是SAMPLE,CODE,CITE,STRONG,EMPHASIS,VARIABLE。

块级元素 (BLOCK-LEVEL ELEMENTS)

The block elements are used for defining a block of text in the HTML document. These elements could be nested and used. It gives a structure of a block containing other block elements. Some common examples are HEADING, PARAGRAPH, BREAK, HR AND CENTER.

块元素用于定义HTML文档中的文本块。 这些元素可以嵌套和使用。 它给出了包含其他块元素的块的结构。 一些常见的示例是HEADING,PARAGRAPH,BREAK,HR和CENTER。

HTML的一些元素 (Some Elements of HTML)

<HTML>

<HTML>

This element defines the ones complete HTML document. Also, it is used as the first tag of the HTML document. It is a container element as it has both the starting and closing tag.

该元素定义了完整HTML文档。 此外,它还用作HTML文档的第一个标签。 这是一个容器元素,因为它同时具有开始和结束标签。

    <HTML> ... </HTML>

<BODY>

<身体>

This element defines the body of the document. The element or the content that has to be added to the webpage is given in the HTML body. It has both the starting and the ending tag.

此元素定义文档的主体。 HTML正文中提供了必须添加到网页的元素或内容。 它同时具有开始和结束标记。

    <BODY> ... </BODY>

<HEAD>

<头>

The element is used for the head of the document. This element contains the title of the document, linking to scripts, adding style by style tag, etc.

该元素用于文档的开头。 该元素包含文档的标题,链接到脚本,通过样式标签添加样式等。

    <HEAD>
        <TITLE> MY TITLE </TITLE>
        <STYLE> . . . </STYLE>
    </HEAD>


翻译自: https://www.includehelp.com/html/introduction-to-elements-in-html.aspx

清除元素中的子元素html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值