Latest web development tutorials

HTML <applet> tag

Examples

An embedded Java applet:

<Applet code = "Bubbles.class" width = "350" height = "350"> Java applet that draws animated bubbles. </ applet>


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

Note: Some browsers still <applet> but require additional plug-ins and installation processes to work.


Tag definitions and instructions

HTML5 does not support the <applet> tag. Please use the <object> tag instead.

In HTML 4.01, <applet> element is obsolete .

<Applet> tag defines an embedded applet.


Differences between HTML 4.01 and HTML5

HTML5 does not support the <applet> tag, HTML 4.01 obsolete <applet> tag.


Required attributes

属性 描述
code URL 规定 Java applet 的文件名。
object name 规定了包含该 applet 的一系列版本的资源名称。

Optional attributes

属性 描述
align left
right
top
bottom
middle
baseline
规定 applet 相对于周围元素的对齐方式。
alt text 规定 applet 的替换文本。
archive URL 规定档案文件的位置。
codebase URL 规定 code 属性中指定的 applet 的基准 URL。
height pixels 规定 applet 的高度。
hspace pixels 定义围绕 applet 的水平间隔。
name name 定义 applet 的名称(用在脚本中的)。
vspace pixels 定义围绕 applet 的垂直间隔。
width pixels 规定 applet 的宽度。


Standard property

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

属性 描述
class classname 规定元素的类名
id id 规定元素的唯一 id
style style_definition 规定元素的行内样式
title text 规定元素的额外信息

For a full description, go to Standard property .


Event Properties

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

For a full description, go to Event Attributes .