📜  什么是 HTML 中的空元素?

📅  最后修改于: 2021-11-07 08:10:41             🧑  作者: Mango

在本文中,我们将看到 HTML 中的空标签,我们还将重点介绍使用空标签的目的。空元素是没有任何嵌入元素或文本元素的组件。空元素没有后继节点。换句话说,不包含任何结束标签的标签是空标签。空标签仅包含开始标签,但它们在网页中执行某些操作。

句法:

没有封闭标记的元素称为空元素。将结束标记添加到空元素将是无效的语法。空元素没有任何子节点。简而言之,Empty 元素是自关闭或无效的,而不是容器标签。空元素用于嵌入图像、列表、中断、水平线、超链接、用于输入、元数据、区域等。例如,

标签有一个结束标签,因此它不是一个空元素。

以下是在 HTML 中使用的空元素列表:

tag in HTML is used to set the column properties for each column within a tag. This tag is used to set the style property to each column. This tag does not contain closing tags.

Elements  

Description

                         

It is used to map a portion of an image to make it clickable by the end-user. It is used to direct the user to different links after the user clicks on the mapped portions of the image. It is used as a child tag of the tag. 

 

For all relative URLs in a document, the base URL is specified to use with the element. Only one element can be used in a document.


The
element is used for a line break in a text (can also be called carriage-return). It is useful in the case of writing an address, story, blogs, etc where the long sentence needs to break for clear visibility.

The

The tag in HTML is used for embedding external applications which are generally multimedia content like audio or video into an HTML document. It is used as a container for embedding plug-ins such as flash animations.


A thematic break between paragraph-level components is represented by the


element. For instance, a change of shift in the topic within a section.

The element is used to embed an image into the document.

                               

This empty element is used to create interactive controls for web-based applications and forms, for accepting the information from the user such as an address, name, phone number, etc, depending on a variety of types of input data and control widgets are available. All the input types and attributes are used inside the element.

The HTML element is used to establish a connection between the current content and an external resource. For instance, we can use it to link the external stylesheet or javascript file, etc.

The HTML element represents metadata i.e., information of a information.

           

The tag in HTML is used to define a parameter for plug-ins which is associated with element. It does not contain the end tag.

The element is an empty element that provides various media resources for the ,

The tag specifies text tracks for media components audio and video. This part is employed to specify subtitles, caption files, or different files containing text, that ought to be visible once the media is taking part in. The element is an empty HTML element that is used as a child of the audio and video media components. It allows you to define timed text tracks (or time-based data), for example, to handle subtitles automatically. WebVTT format (.vtt files) — Web Video Text Tracks — is used for the tracks.

The tag in HTML stands for word break opportunity and is used to define the position within the text which is treated as a line break by the browser. It is mostly used when the used word is too long and there are chances that the browser may break lines at the wrong place for fitting the text.

下面的代码示例说明了空元素的使用。我们在这里只使用了其中的几个。

例子:

HTML


  
    
    
    
    Empty Element
  
    
  
    
    

br tag

    5th Floor, A-118,
    Sector-136, Noida,
    Uttar Pradesh - 201305
    

hr tag

    
    

col tag

                                                                                                                        
Sr. noTitlePrice
1234GeeksForGeeks$10
    

img tag

         

input tag

    
           
  


输出: