#12003/5/24 17:08:26
Html
——iframe使用语法
%coreattrs; -- id, class, style, title --
Longdesc %URI; #IMPLIED -- link to long description
(complements title) --
Name CDATA #IMPLIED -- name of frame for targetting --
Src %URI; #IMPLIED -- source of frame content --
Frameborder (1|0) 1 -- request frame borders? --
Marginwidth %Pixels; #IMPLIED -- margin widths in pixels --
Marginheight %Pixels; #IMPLIED -- margin height in pixels --
Scrolling (yes |no | auto) auto -- scrollbar or none --
Align %IAlign; #IMPLIED -- vertical or horizontal alignment --
Height %Length; #IMPLIED -- frame height --
Width %Length; #IMPLIED -- frame width --
>
Attribute definitions
Name = cdata [CI]
This attribute assigns a name to the current frame. This name may be used as the target of subsequent links.
longdesc = uri [CT]
This attribute specifies a link to a long description of the frame. This description should supplement the short description provided using the title attribute, and may be particularly useful for non-visual user agents.
src = uri [CT]
This attribute specifies the location of the initial contents to be contained in the frame.
noresize [CI]
When present, this boolean attribute tells the user agent that the frame window must not be resizeable.
scrolling = auto|yes|no [CI]
This attribute specifies scroll information for the frame window. Possible values
auto: This value tells the user agent to provide scrolling devices for the frame window when necessary. This is the default value.
yes: This value tells the user agent to always provide scrolling devices for the frame window.
no: This value tells the user agent not to provide scrolling devices for the frame window.
frameborder = 1|0 [CN]
This attribute provides the user agent with information about the frame border. Possible values:
1: This value tells the user agent to draw a separator between this frame and every adjoining frame. This is the default value.
0: This value tells the user agent not to draw a separator between this frame and every adjoining frame. Note that separators may be drawn next to this frame nonetheless if specified by other frames.
marginwidth = pixels [CN]
This attribute specifies the amount of space to be left between the frame's contents in its left and right margins. The value must be greater than zero (pixels). The default value depends on the user agent.
marginheight = pixels [CN]
This attribute specifies the amount of space to be left between the frame's contents in its top and bottom margins. The value must be greater than zero (pixels). The default value depends on the user agent.
Attributes defined elsewhere
id, class (document-wide identifiers)
title (element title)
style (inline style information)
把w3c的原文放在这里并不是想吓唬任何人,只是觉得应该告诉大家学习一门语法的方法。在能力允许的范围内尽可能自己去查阅原版的官方文档,这样你不仅可以拿到最完整的信息,而且这是一个高手成长之路。翻译的东西多半掺有个人想法,以及个人能力的有限都造成这样一种局面:很难在翻译的教材里面找到完整的相关信息,从而使个人的技术水平一直停留在相对低的水平。好了废话说了一大堆就是想和大家分享学习的方法。为了照顾到一些英文水平比较低的朋友,我就简要的做些翻译解释。
Iframe是个比较新的标识。但是从它的参数来说和普通的html标识没有什么大的区别,相
信大家都用过frame(框架)来布局你的网页,其实iframe和frame功能一样,不同的是它是个浮动框架,你可以把iframe布置在你网页中的任何位置,包括层中,这种极大的自由度可以给网页设计带来很大的灵活性,所以学会使用它是非常必要的。
下面介绍它的主要属性
Name="" 给框架命名,这样就可以使用你的命名为链接中的target属性提供参数
Src="" 当前框架所链接的页面地址
Frameborder="" 浮动框架的边框大小,默认值为1显示边框,一般最好设为0不显示
Marginwidth="" 浮动框架框边与插入页面之间空白的宽度,单位pixels
Marginheight="" 浮动框架框边与插入页面空白的高度,单位pixels
Scrolling="" 滚动条,有3个值:auto自动,yes 总是显示,no 不显示
align="MIDDLE" 可选值为 left, right, top, middle, bottom,作用不大
width=""
height="" 浮动框架的宽及长,单位pixels。
Noresize 浮动框架大小不可变
其它的属性就是id ,class ,title ,style。
举个例子:
个人认为比较有用的就是name, src, frameborder, scrolling, width, height.另几个作用不是很大。
好了,说了半天。
高手们不要扔我,新手们有什么问题可以一起探讨。
编辑历史:[这消息被yolan编辑过(编辑时间2003-05-24 17:10:04)]
还是我吗
过去的失去
未来的还没得到
现在呢
……