·首页 >> 网友交流 >> html 代码简介<2>

 

 

 

 

 

◇〔共三页〕上一页 下一页

html 代码简介

〔二〕


本资料收集于网络,仅供参考·《子夜星》网站整理编注


  说明 <!-- *** --> (浏览器不会显示)

  档案型态声明 <!doctype html public "-//ietf//dtd html 2.0//en">

  3.0 档案型态声明 <!doctype html public "-//w3o//dtd w3 html 3.0//en">

  可搜寻 <isindex> (指示可搜寻的索引项)

  n1.0 提示 <isindex prompt="***"> (要求输入的提示文字)

  送出搜寻条件 <a href="url?***"></a> (其中的问号不是数字,而是「问号」)

  基本档案的url <base href="url"> (必须放在「文头」区段内)

  n2.0 基本视窗名称 <base target="***"> (必须放在「文头」区段内)

  相关性 <link rev="***" rel="***" href="url"> (必须放在「文头」区段内)

  背景资讯 <meta> (必须放在「文头」区段内)

  浮动帧标记iframe,空姐看来哦[/color]

  你的网页中一定有 banner,栏目图片,版权等一大堆雷同的东西,出于网站风格统一,本无可厚非,但是有没有办法,让这些雷同的东西一次下载后就不用再下载,而只下载那些内容有变化区域的网页内容呢? 人们首先想到了帧标记 frame,将整个页面划分为若干帧。可是 frame 却不能随意指定帧的位置,它至少要有一条边与页面的四边重合,灵活性大受影响。为了能在页面的任何位置嵌入 html 文件,我们可以使用帧标记 frame 的兄弟浮动帧标记 iframe,虽然 nestscape 浏览器不支持 iframe 标记,但在时下 ie 的天下,这似乎也无大碍。

  iframe 标记,又叫浮动帧标记,你可以用它将一个 html 文件嵌入在另一个 html 中显示。它不同于 frame 标记最大的特征即这个标记所引用的 html 文件不是与另外的 html文件相互独立显示,而是可以直接嵌入在一个 html 文件中,与这个html 文件内容相互融合,成为一个整体,另外,还可以多次在一个页面内显示同一内容,而不必重复写内容,甚至可以在同一 html 文件嵌入多个 html 文件。

  在脚本语言与对象层次中,包含 iframe 的窗口我们称之为父窗体,而浮动帧则称为子窗体,弄清这两者的关系很重要,因为要在父窗体中访问子窗体或子窗体中访问父窗体都必须清楚对象层次,才能通过程序来访问并控制窗体。

  下面是浮动帧标记 iframe 的各项属性:

  一、基本语法:

  <iframe>……</iframe>

  浮动帧标记 iframe 必须成对出现,即有开始标记<iframe>,就必须有结束标记</iframe>。

  二、浮动帧标记 iframe 的属性:

  1、文件位置:

  语法:src=url

  说明:url 为嵌入的 html 文件的位置,可以是相对地址,也可以是绝对地址。

  示例:<iframe src="iframe.html">

  2、对象名称:

  语法:name=#

  说明:#为对象的名称。该属性给对象取名,以便其他对象利用。

  示例:<iframe src="iframe.html" name="iframe1">

  3、id选择符:

  语法:id=#

  说明:指定该标记的唯一id选择符。

  示例:<iframe src="iframe.html" id="iframe1">

  4、容器属性:

  语法:height=# width=#

  说明:该属性指定浮动帧的高度和宽度。取值为正整数(单位为像素)或百分数。

  height:指定浮动帧的高度;

  width:指定浮动帧的宽度。

  示例:<iframe src="iframe.html" height=400 width=400>

  5、尺寸调整:

  语法:noresize

  说明:ie专有属性,指定浮动帧不可调整尺寸。

  示例:<iframe src="iframe.html" noresize>

  6、边框显示:

  语法:frameborder=0、1

  说明:该属性规定是否显示浮动帧边框。

  0:不显示浮动帧边框;

  1:显示浮动帧边框。

  示例:<iframe src="iframe.html" frameborder=0>
     <iframe src="iframe.html" frameborder=1>

  7、边框厚度:

  语法:border=#

  说明:该属性指定浮动帧边框的厚度,取值为正整数和0,单位为像素。为了将浮动帧与页面无缝结合,border一般等于0。

  示例:<iframe src="iframe.html" border=1>

  8、边框颜色:

  语法:bordercolor=color

  说明:该属性指定浮动帧边框的颜色。color 可以是 rgb 色(rrggbb),也可以是颜色名。

  示例:<iframe src="iframe.html" bordercolor=red>

  9、对齐方式:

  语法:align=left、right、center

  说明:该属性指定浮动帧与其他对象的对齐方式。

  left:居左;

  right:居右;

  center:居中。

  示例:<iframe src="iframe.html" align=left>
     <iframe src="iframe.html" align=right>
     <iframe src="iframe.html" align=center>

  10、相邻间距:

  语法:framespacing=#

  说明:该属性指定相邻浮动帧之间的间距。取值为正整数和0,单位为像素。

  示例:<iframe src="iframe.html" framespacing=10>

  11、内补白属性:

  语法:hspace=# vspace=#

  说明:该属性指定浮动帧内的边界大小。取值为正整数和 0,单位为像素。两个属性应同时应用。

  hspace:浮动帧内的左右边界大小;

  vspace:浮动帧内的上下边界大小。

  示例:<iframe src="iframe.html" hspace=1 vspace=1>

  12、外补白属性:

  语法:marginheight=# marginwidth=#

  说明:该属性指定浮动帧的边界大小。取值为正整数和 0,单位为像素。两个属性应同时应用。

  marginheight:浮动帧的左右边界大小;

  marginwidth:浮动帧的上下边界大小。

  示例:<iframe src="iframe.html" marginheight=1 marginwidth=1>


  ── iframe使用语法

<!element iframe - - (%flow* -- inline subwindow -->
<!attlist 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)
 

下一页:html 代码简介〔三〕
  
 

 

 

 

 


 

子夜星网站
 E-mail:    Created by LNZGW since 2000.1.1. Copyright ©.