<!ENTITY % OAlign "(texttop|middle|textmiddle|baseline| 牋牋牋牋牋牋牋牋牋牋牋牋牋牋 textbottom|left|center|right)"> <!ELEMENT OBJECT - - (PARAM | %block)*> <!ATTLIST OBJECT � %attrs牋牋牋牋牋牋牋牋牋牋牋牋牋 -- %coreattrs, %i18n, %events -- � declare牋牋 (declare)� #IMPLIED� -- declare but don't instantiate flag -- � classid牋牋 %URL牋牋牋 #IMPLIED� -- identifies an implementation -- � codebase牋� %URL牋牋牋 #IMPLIED� -- some systems need an additional URL -- � data牋牋牋� %URL牋牋牋 #IMPLIED� -- reference to object's data -- � type牋牋 %ContentType #IMPLIED� -- Internet content type for data -- � codetype %ContentType #IMPLIED� -- Internet content type for code -- � standby牋牋 CDATA牋牋� #IMPLIED� -- message to show while loading -- � align牋牋牋 %OAlign牋� #IMPLIED� -- positioning inside document -- � height牋牋� %Length牋� #IMPLIED� -- suggested height -- � width牋牋牋 %Length牋� #IMPLIED� -- suggested width -- � border牋牋� %Length牋� #IMPLIED� -- suggested link border width -- � hspace牋牋� %Length牋� #IMPLIED� -- suggested horizontal gutter -- � vspace牋牋� %Length牋� #IMPLIED� -- suggested vertical gutter -- � usemap牋牋� %URL牋牋牋 #IMPLIED� -- reference to image map -- � shapes牋牋� (shapes)牋 #IMPLIED� -- object has shaped hypertext links -- � name牋牋牋� %URL牋牋牋 #IMPLIED� -- submit as part of form -- � tabindex牋� NUMBER牋牋 #IMPLIED� -- position in tabbing order -- � >开 始 标 记: 需 要, 结 束 标 记: 需 要
在 HTML 中,� OBJECT 元 素 指 定 了 渲 染 结 构 的 位 置 以 及 渲 染 结 构 需 的 数 据 的 位 置. 这 些 特 性 通 过 OBJECT 元 素 的 信 息 来 指 定. PARAM 元 素 指 一 个 动 行 态 值 的 集. 我 们 在 后 面 研 究 这 个 元 素, 在 物件初始化 部 分.
一 个 用 户 代 理 器 必 须 根 据 下 列 的 优 先 权 法 则 来 解 译 OBJECT 元 素:
牋牋 <OBJECT classid="http://www.miamachina.it/analogclock.py"> </OBJECT>我 们 建 议 通 过 包 含 OBJECT 内 容 中 的 交 互 文 字 来 完 成 这 个 声 明. 此 例 中 用 户 代 理 器 无 法 渲 染 这 个 钟.
牋牋 <OBJECT classid="http://www.miamachina.it/analogclock.py"> An animated clock. </OBJECT>注 意 用 户 代 理 器 将 在 解 译 OBJECT 声 明 的 同 时 渲 染 这 个 种. 在 物 件 第 一 次 声 明 时 渲 染 结 构 可 能 会 延 迟 (在 下 描 述).
<OBJECT title="The Earth as seen from space" 牋牋牋牋牋 classid="http://www.observer.mars/TheEarth.py"> <OBJECT data="TheEarth.mpeg" type="application/mpeg"> � <OBJECT src="TheEarth.gif"> 牋 The <STRONG>Earth</STRONG> as seen from space. � </OBJECT> </OBJECT> </OBJECT>外 部 声 明 指 定 一 个 小 运 行 程 式 不 需 要 数 据 和 初 始 值. 第 二 个 声 明 指 明 一 个 MPEG 电 影 并 且 由 于 没 有 定 义 一 个 渲 染 结 构, 它 依 靠 用 户 代 理 器 来 处 理 这 个 动 画. 我 们 还 设 置 了 type 特性 因 此 用 户 代 理 器 可 以 选 择 不 从 网 路 上 取 回 "TheEarth.mpeg" 也 不 渲 染 它. 第 三 个 指 定 指 定 了� GIF 文 件 的 位 置 以 及 当 所 的 的 结 构 失 败 时 的 交 互 文 本.
<!ELEMENT PARAM - O EMPTY牋牋牋 -- named property value --> <!ATTLIST PARAM � name牋牋牋� CDATA牋牋� #REQUIRED -- property name -- � value牋牋牋 CDATA牋牋� #IMPLIED� -- property value -- � valuetype (DATA|REF|OBJECT) DATA -- How to interpret value -- � type牋牋牋� CDATA牋牋� #IMPLIED� -- Internet media type -- � >开 始 标 记: 需 要, 结 束 标 记: 禁 止
牋牋 <OBJECT classid="http://www.miamachina.it/analogclock.py"> <PARAM name="height" value="40" valuetype="data"> <PARAM name="width" value="40" valuetype="data"> This user agent cannot render Python apps. </OBJECT>由 于 PARAM 元 素 的 缺 省 valuetype 是 "data", 我 们 可 以 把 前 面 的 声 明 替 换 为:
� <PARAM name="height" value="40"> <PARAM name="width" value="40" >或:
� <PARAM name="height" value="40" data> <PARAM name="width" value="40"� data>
<OBJECT classid="http://www.gifstuff.com/gifappli" 牋牋牋 standby="Loading Elvis..."> <PARAM name="Init_values" 牋牋牋 value="./images/elvis.gif"> 牋牋牋 valuetype="ref"> </OBJECT>
<OBJECT classid="java:program.start"> </OBJECT>通 过 设 定 codetype 特 性, 用 户 代 理 器 可 以 根 据 如 此 做 的 能 力 来 决 定 是 否 取 得 Java 应 用 程 式.
<OBJECT codetype="application/octet-stream" 牋牋牋牋牋 classid="java:program.start"> </OBJECT>某 些 渲 染 方 案 需 要 额 外 的 信 息 来 标 识 它 们 的 履 行 并 且 必 须 告 知 哪 里 去 找 寻 这 些 信 息. 你 可 以 通 过 codebase 特 性 向 渲 染 机 制 提 供 路 径 信 息.
<OBJECT codetype="application/octet-stream" 牋牋牋牋牋 classid="java:program.start"> 牋牋牋牋牋 codebase="http://foooo.bar.com/java/myimplementation/" </OBJECT>
<OBJECT classid="clsid:663C8FEF-1EF9-11CF-A3DB-080036F12502" 牋牋牋牋牋 data="http://www.acme.com/ole/clock.stm"> This application is not supported. </OBJECT>
一 个 通 过 declare 特 性 的 渲 染 机 制 是 一 个� OBJECT 每 次 参 照 的 实 例.
<OBJECT declare 牋牋牋牋牋 id="earth_declaration"� 牋牋牋牋牋 data="TheEarth.mpeg"� 牋牋牋牋牋 type="application/mpeg"> � <OBJECT src="TheEarth.gif"> 牋 The <STRONG>Earth</STRONG> as seen from space. � </OBJECT> </OBJECT> ...later in the document... Click to see a neat <A href="#earth_declaration"> animation of The Earth!</A>
<OBJECT declare 牋牋 id="tribune" 牋牋 type="application/x-webfont" 牋牋 data="tribune.gif"> </OBJECT> ...view the poem in KublaKhan.txt here... <OBJECT classid="http://foo.bar.com/poem_viewer"� 牋牋牋牋牋 data="KublaKhan.txt"> <PARAM name="font" valuetype="object" value="#tribune"> <P>You're missing a really cool poem viewer ... </OBJECT>
align 特 性 指 定 了 一 个 元 素 的 位 置 attribute specifies the position of an object with respect to its context.
下 面 的 值 在 文 字 之 中 放 置 一 个 物 件:
<!-- To avoid problems with text-only UAs you need to provide 牋牋 a description with ALT, and avoid server-side image maps --> <!ELEMENT IMG - O EMPTY牋牋� --� Embedded image --> <!ATTLIST IMG � %attrs;牋牋牋牋牋牋牋牋牋牋牋牋� -- %coreattrs, %i18n, %events -- � src牋牋牋牋 %URL牋牋牋 #REQUIRED -- URL of image to embed -- � alt牋牋牋牋 CDATA牋牋� #IMPLIED� -- description for text only browsers -- � align牋牋牋 %IAlign牋� #IMPLIED� -- vertical or horizontal alignment -- � height牋牋� %Pixels牋� #IMPLIED� -- suggested height in pixels -- � width牋牋牋 %Pixels牋� #IMPLIED� -- suggested width in pixels -- � border牋牋� %Pixels牋� #IMPLIED� -- suggested link border width -- � hspace牋牋� %Pixels牋� #IMPLIED� -- suggested horizontal gutter -- � vspace牋牋� %Pixels牋� #IMPLIED� -- suggested vertical gutter -- � usemap牋牋� %URL牋牋牋 #IMPLIED� -- use client-side image map -- � ismap牋牋牋 (ismap)牋� #IMPLIED� -- use server-side image map -- � >开 始 标 记: 需 要, 结 束 标 记: 禁 止
这 个 元 素 的 height 和 width 特 性 代 替 了 源 图 像 的 自 然 高 度 和 宽 度. 用 户 代 理 器 应 当 相 宜 地 缩 放 图 像.
...preceding text... I just returned from vacation! Here's a photo of my family at the lake: <IMG src="http://www.somecompany.com/People/Ian/vacation/family.png" 牋牋 alt="A photo of my family at the lake.">This may be expressed with the OBJECT element as follows:
...preceding text... I just returned from vacation! Here's a photo of my family at the lake: <OBJECT data="http://www.somecompany.com/People/Ian/vacation/family.png" 牋牋牋� type="image/png"> A photo of my family at the lake. </OBJECT>
对 齐 特 性 指 明 一 个 元 素 与 上 下 文 的 位 置.
下 列 的 值 把 一 个 物 件 放 入 文 字 之 中:
<!ELEMENT APPLET - - (PARAM | %inline)*> <!ATTLIST APPLET � codebase牋� %URL牋牋牋 #IMPLIED牋 -- optional base URL for applet -- � archive牋牋 CDATA牋牋� #IMPLIED牋 -- comma separated archive list -- � code牋牋牋� CDATA牋牋� #IMPLIED牋 -- applet class file -- � object牋牋� CDATA牋牋� #IMPLIED牋 -- serialized applet file -- � alt牋牋牋牋 CDATA牋牋� #IMPLIED牋 -- description for text only browsers -- � name牋牋牋� CDATA牋牋� #IMPLIED牋 -- allows applets to find each other -- � width牋牋牋 %Pixels牋� #REQUIRED� -- suggested width in pixels -- � height牋牋� %Pixels牋� #REQUIRED� -- suggested height in pixels -- � align牋牋牋 %IAlign牋� #IMPLIED牋 -- vertical or horizontal alignment -- � hspace牋牋� %Pixels牋� #IMPLIED牋 -- suggested horizontal gutter -- � vspace牋牋� %Pixels牋� #IMPLIED牋 -- suggested vertical gutter -- � >开 始 标 记: 需 要, 结 束 标 记: 需 要
APPLET 的 内 容 作 为 不 支 持 这 个 元 素 或 设 置 为 不 支 持 小 运 行 程 式 的 用 户 代 理 器 的 轮 替 文 字. 这 个 内 容 在 其 它 情 况 必 须 被 忽 略.
<APPLET code="Bubbles.class" width="500" height="500"> Java applet that draws animated bubbles. </APPLET>可 以 如 下 用 OBJECT:重 写
<OBJECT codetype="application/octet-stream" 牋牋牋� classid="java:Bubbles.class" 牋牋牋� width="500" height="500"> Java applet that draws animated bubbles. </OBJECT>
<APPLET code="AudioItem" width="15" height="15"> <PARAM name="snd" value="Hello.au|Welcome.au"> Java applet that plays a welcoming sound. </APPLET>如 下 可 用 OBJECT 写 成:
<OBJECT codetype="application/octet-stream" 牋牋牋� classid="AudioItem"� 牋牋牋� width="15" height="15"> <PARAM name="snd" value="Hello.au|Welcome.au"> Java applet that plays a welcoming sound. </OBJECT>
...text before... <OBJECT data="file_to_include.html"> Warning: file_to_include.html could not be included. </OBJECT> ...text after...
一 个 图 像 映 像 通 过 在 物 件 上 联 系 一 个 敏 感 的 几 何 学 区 域 被 建 立.
有 两 种 图 像 映 像:
<OBJECT data="navbar.gif" shapes> <A href="guide.html" shape="rect" coords="0,0,118,28">Access Guide</a> | <A href="shortcut.html" shape="rect" coords="118,0,184,28">Go</A> | <A href="search.html" shape="circ" coords="184,200,60">Search</A> | <A href="top10.html" shape="poly" coords="276,0,373,28,50,50,276,0">Top Ten</A> </OBJECT>
如 果 两 个 或 更 多 的 定 义 区 域 交 叉, 首 先 被 定 义 的 区 域 具 有 优 先 权 (就 是 说 响 应 用 户 输 入).
<!ELEMENT MAP - - (AREA)*> <!ATTLIST MAP � %coreattrs;牋牋牋牋牋牋牋牋牋牋� -- id, class, style, title -- � name牋牋牋� CDATA牋牋 #IMPLIED � >开 始 标 记: 需 要, 结 束 标 记: 需 要
<!ELEMENT AREA - O EMPTY> <!ATTLIST AREA � shape牋牋牋 %Shape牋� rect牋牋� -- controls interpretation of coords -- � coords牋牋� %Coords牋 #IMPLIED� -- comma separated list of values -- � href牋牋牋� %URL牋牋� #IMPLIED� -- this region acts as hypertext link -- � target牋牋� CDATA牋牋 #IMPLIED� -- where to render linked resource --� � nohref牋牋� (nohref)� #IMPLIED� -- this region has no action -- � alt牋牋牋牋 CDATA牋牋 #REQUIRED -- description for text only browsers -- � tabindex牋� NUMBER牋� #IMPLIED� -- position in tabbing order -- � >
<OBJECT data="navbar1.gif" usemap="#map1"></OBJECT> <MAP name="map1"> <AREA href="guide.html"� 牋牋牋牋� alt="Access Guide"� 牋牋牋牋� shape="rect"� 牋牋牋牋� coords="0,0,118,28"> <AREA href="search.html"� 牋牋牋牋� alt="Search"� 牋牋牋牋� shape="rect"� 牋牋牋牋� coords="184,0,276,28"> <AREA href="shortcut.html"� 牋牋牋牋� alt="Go"� 牋牋牋牋� shape=circ� 牋牋牋牋� coords="184,200,60"> <AREA href="top10.html"� 牋牋牋牋� alt="Top Ten"� 牋牋牋牋� shape="poly"� 牋牋牋牋� coords="276,0,373,28,50,50,276,0"> </MAP>
唯 一 可 能 的 定 义 客 户 端 图 像 映 像 的 方 法 是 通 过 IMG 元 素. 要 这 样 做, 在 IMG 定 义 中 设 定 布 尔 特 性ismap. 区 域 的 相 关 映 像 必 须 通 过 usemap 特 性 指 定.
当 用 户 激 活 一 个 图 像 映 像 的 区 域 时, 屏 幕 的 坐 标 值 直 接 被 发 送 到 文 档 所 在 的 服 务 器. 屏 幕 坐 标 由 屏 幕 像 素 值 表 示. 关 于 标 准� 的 像 素 定 义 和 缩 放 的 信 息, 请 参 阅 [CSS1].
单 击 的 位 置 如 下 被 传 到 服 务 器. 用 户 代 理 根 据 href 特 性 指 定 的 URL 并 加 上 "?" 后 随 x 和 y 坐 标, 用 逗 号 分 列. 后 随 的 链 接 则 使 用 新 的 URL. 例 如, 在 前 例 中, 如 果 用 户 单 击 的 位 置 为 x=10, y=27 则 生 成 的 URL 为 "/cgibin/navbar.map?10,27".
<OBJECT data="game.gif" shapes> � <A href="guide.html" shape="rect" coords="0,0,118,28"> 牋牋牋� Rules of the Game</A> � <A href="http://www.acme.com/cgi-bin/competition" 牋牋牋� ismap� 牋牋牋� shape="default"> 牋牋牋� Guess the location</a> </OBJECT>
height 和 width 特 性 给 用 户 代 理 器 一 个 图 像 或 物 件 的 尺 寸 的 主 意, 所 以 它 们 可 以 保 留 它 们 的 空 间 并 继 续� 在 等 待 图 像 数 据 时 渲 染 文 档. 两 个 特 性 均 使 用 长度 类 型 的 值. 用 户 代 理 器 可 以 缩 放 物 件 和 图 像 来 符 合 这 些 相 宜 的 值.
vspace 和 hspace 特 性 指 定 来 插 入 到 图 像 左 边 与 右 边 (hspace) 和 上 边 与 下 边 (vspace) 的 空 白 的 数 量. 这 个 特 性 的 缺 省 值 没 有 被 指 定, 但 通 常 是 小 的 , 非 零 长 度 的. 两 个 特 性 均 使 用 长度 类 型 的 值.
包 含 一 个 A 元 素 的 图
像 或 物 件 有 时 周 围 有 一 个 框 线. border
特 性 指 定 了 这 种 框 线 的 宽 度.
如何指定轮替文字特
性 定 义
由 于 轮 替 文 字 非 常 有 用, 它 必 须 被 小 心 处 理. 作 者 应 当 服 从 下 列 的 引 导 规 则:
当 一 个 作 者 没 有 设 定 IMG 或 APPLET 元 素 的 alt 特 性 时, 用 户 代 理 器 将 按 下 列 的 次 序 计 算 提 供 轮 替 文 字.