English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

HTML 参考手册

HTML 标签大全

HTML: <applet> Tag

HTML中的Applet元素( <applet>) 表示包含了Java的applet。这个元素在HTML5中已经废弃,不能再被使用。网页开发者应该使用更通用的元素。

在线示例

一个嵌入的Java applet:

<!DOCTYPE html>
<html>
<head> 
<meta charset="utf-8"> 
<title>基础教程网(w3(codebox.com)</title> 
</head>
<body>
<applet code="Bubbles.class" width="350" height="350">
Java applet,它绘制动画气泡。
</applet>
</body>
</html>

浏览器兼容性

IEFirefoxOperaChromeSafari

注意:某些浏览器中依然存在对<applet>的支持,但是需要额外的插件和安装过程才能起作用。

标签定义及使用说明

HTML5 不支持<applet>标签。请使用 <object><embed> 标签来代替它。

In HTML 4.01 中,<applet>元素已废弃。

<applet>标记定义一个嵌入式的applet。

HTML 4.01 与HTML5之间的差异

HTML5 不支持<applet>标签,HTML 4.01 已废弃<applet>标签。

必需属性

attributevaluedescription
codeURL规定Java applet的文件名。
objectname规定了包含该applet的一系列版本的资源名称。

可选属性

attributevaluedescription
对齐左侧
右侧
顶部
底部
中间
基线
定义applet相对于周围元素的对齐方式。
alttextspecify the alternative text for the applet.
archiveURLspecify the location of the archive file.
codebaseURLspecify the base URL of the applet specified in the code attribute.
heightpixelsspecify the height of the applet.
hspacepixelsdefine the horizontal spacing around the applet.
namenamedefine the name of the applet (used in scripts).
vspacepixelsdefine the vertical spacing around the applet.
widthpixelsspecify the width of the applet.

Standard Attributes

In HTML 4.01 in the <applet> tag supports the following standard attributes:

attributevaluedescription
classclassnamespecify the class name of the element
ididspecify the unique id of the element
stylestyle_definitiondefine the inline style of the element
titletextspecify additional information about the element

For a complete description, please visitStandard Attributes.

Event Attributes

In HTML 4.01 where the <applet> tag does not support any event attributes.

For a complete description, please visitEvent Attributes.