📜  如何在 HTML5 中设置对象的名称?

📅  最后修改于: 2021-10-31 05:38:32             🧑  作者: Mango

HTML5 中的 元素用于以任何图像或任何嵌套链接的网页或内容或任何可以完成相同工作的插件的形式链接任何外部文件和资源。

句法:

最初 旨在将不同的应用程序和浏览器插件嵌入其中,主要用于扩展浏览器的可用性。

可以在此元素中传递的属性:

Attribute Value Description
data URL It specifies the URL of data in the object.
type media_type It specifies the media type of data specified in the data attribute.
typemustmatch boolean It indicates that the resource should be embedded only if the value of the type attribute matches with the type of resource provided on the data attribute.
align left, right, top, bottom It defines the alignment of the objects.
border pixels It specifies the border around the object.
height pixels It specifies the height of the object.
hspace pixels It specifies the white space on the left and right sides of the object.
vspace pixels It specifies the white space on the top and bottom of the object.
width pixels It specifies the width of the object.
name name It specifies the name of an object.
form form_id It specifies the form id to which the object element belongs to.

示例:以下示例代码反对链接图像、视频和某些其他网页的任何 HTML 链接:

HTML


  

  
    

Example of an object element in HTML5