雜項(xiàng)
說(shuō)明 <!-- *** --> (瀏覽器不會(huì)顯示)
檔案型態(tài)聲明 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
3.0 檔案型態(tài)聲明 <!DOCTYPE HTML PUBLIC "-//W3O//DTD W3 HTML 3.0//EN">
可搜尋 <ISINDEX> (指示可搜尋的索引項(xiàng))
N1.0 提示 <ISINDEX PROMPT="***"> (要求輸入的提示文字)
送出搜尋條件 <A HREF="URL?***"></a> (其中的問(wèn)號(hào)不是數(shù)字,而是「問(wèn)號(hào)」)
基本檔案的URL <BASE HREF="URL"> (必須放在「文頭」區(qū)段內(nèi))
N2.0 基本視窗名稱 <BASE TARGET="***"> (必須放在「文頭」區(qū)段內(nèi))
相關(guān)性 <LINK REV="***" REL="***" HREF="URL"> (必須放在「文頭」區(qū)段內(nèi))
背景資訊 <META> (必須放在「文頭」區(qū)段內(nèi))
浮動(dòng)幀標(biāo)記IFRAME,空姐看來(lái)哦[/COLOR]
你的網(wǎng)頁(yè)中一定有Banner,欄目圖片,版權(quán)等一大堆雷同的東西,出于網(wǎng)站風(fēng)格統(tǒng)一,本無(wú)可厚非,但是有沒(méi)有辦法,讓這些雷同的東西一次下載后就不用再下載,而只下載那些內(nèi)容有變化區(qū)域的網(wǎng)頁(yè)內(nèi)容呢? 人們首先想到了幀標(biāo)記Frame,將整個(gè)頁(yè)面劃分為若干幀。可是Frame卻不能隨意指定幀的位置,它至少要有一條邊與頁(yè)面的四邊重合,靈活性大受影響。為了能在頁(yè)面的任何位置嵌入HTML文件,我們可以使用幀標(biāo)記frame的兄弟浮動(dòng)幀標(biāo)記Iframe,雖然Nestscape瀏覽器不支持Iframe標(biāo)記,但在時(shí)下IE的天下,這似乎也無(wú)大礙。
Iframe標(biāo)記,又叫浮動(dòng)幀標(biāo)記,你可以用它將一個(gè)HTML文件嵌入在另一個(gè)HTML中顯示。它不同于Frame標(biāo)記最大的特征即這個(gè)標(biāo)記所引用的HTML文件不是與另外的HTML文件相互獨(dú)立顯示,而是可以直接嵌入在一個(gè)HTML文件中,與這個(gè)HTML文件內(nèi)容相互融合,成為一個(gè)整體,另外,還可以多次在一個(gè)頁(yè)面內(nèi)顯示同一內(nèi)容,而不必重復(fù)寫內(nèi)容,甚至可以在同一HTML文件嵌入多個(gè)HTML文件。
在腳本語(yǔ)言與對(duì)象層次中,包含Iframe的窗口我們稱之為父窗體,而浮動(dòng)幀則稱為子窗體,弄清這兩者的關(guān)系很重要,因?yàn)橐诟复绑w中訪問(wèn)子窗體或子窗體中訪問(wèn)父窗體都必須清楚對(duì)象層次,才能通過(guò)程序來(lái)訪問(wèn)并控制窗體。
下面是浮動(dòng)幀標(biāo)記Iframe的各項(xiàng)屬性:
一、基本語(yǔ)法:
<iframe>……</iframe>
浮動(dòng)幀標(biāo)記Iframe必須成對(duì)出現(xiàn),即有開始標(biāo)記<iframe>,就必須有結(jié)束標(biāo)記</iframe>。
二、浮動(dòng)幀標(biāo)記Iframe的屬性:
1、文件位置:
語(yǔ)法:src=url
說(shuō)明:url為嵌入的HTML文件的位置,可以是相對(duì)地址,也可以是絕對(duì)地址。
示例:<iframe src="iframe.html">
2、對(duì)象名稱:
語(yǔ)法:name=#
說(shuō)明:#為對(duì)象的名稱。該屬性給對(duì)象取名,以便其他對(duì)象利用。
示例:<iframe src="iframe.html" name="iframe1">
3、ID選擇符:
語(yǔ)法:id=#
說(shuō)明:指定該標(biāo)記的唯一ID選擇符。
示例:<iframe src="iframe.html" id="iframe1">
4、容器屬性:
語(yǔ)法:height=# width=#
說(shuō)明:該屬性指定浮動(dòng)幀的高度和寬度。取值為正整數(shù)(單位為像素)或百分?jǐn)?shù)。
height:指定浮動(dòng)幀的高度;
width:指定浮動(dòng)幀的寬度。
示例:<iframe src="iframe.html" height=400 width=400>
5、尺寸調(diào)整:
語(yǔ)法:noresize
說(shuō)明:IE專有屬性,指定浮動(dòng)幀不可調(diào)整尺寸。
示例:<iframe src="iframe.html" noresize>
6、邊框顯示:
語(yǔ)法:frameborder=0、1
說(shuō)明:該屬性規(guī)定是否顯示浮動(dòng)幀邊框。
0:不顯示浮動(dòng)幀邊框;
1:顯示浮動(dòng)幀邊框。
示例:<iframe src="iframe.html" frameborder=0>
<iframe src="iframe.html" frameborder=1>
7、邊框厚度:
語(yǔ)法:border=#
說(shuō)明:該屬性指定浮動(dòng)幀邊框的厚度,取值為正整數(shù)和0,單位為像素。為了將浮動(dòng)幀與頁(yè)面無(wú)縫結(jié)合,border一般等于0。
示例:<iframe src="iframe.html" border=1>
8、邊框顏色:
語(yǔ)法:bordercolor=color
說(shuō)明:該屬性指定浮動(dòng)幀邊框的顏色。color可以是RGB色(RRGGBB),也可以是顏色名。
示例:<iframe src="iframe.html" bordercolor=red>
9、對(duì)齊方式:
語(yǔ)法:align=left、right、center
說(shuō)明:該屬性指定浮動(dòng)幀與其他對(duì)象的對(duì)齊方式。
left:居左;
right:居右;
center:居中。
示例:<iframe src="iframe.html" align=left>
<iframe src="iframe.html" align=right>
<iframe src="iframe.html" align=center>
10、相鄰間距:
語(yǔ)法:framespacing=#
說(shuō)明:該屬性指定相鄰浮動(dòng)幀之間的間距。取值為正整數(shù)和0,單位為像素。
示例:<iframe src="iframe.html" framespacing=10>
11、內(nèi)補(bǔ)白屬性:
語(yǔ)法:hspace=# vspace=#
說(shuō)明:該屬性指定浮動(dòng)幀內(nèi)的邊界大小。取值為正整數(shù)和0,單位為像素。兩個(gè)屬性應(yīng)同時(shí)應(yīng)用。
hspace:浮動(dòng)幀內(nèi)的左右邊界大小;
vspace:浮動(dòng)幀內(nèi)的上下邊界大小。
示例:<iframe src="iframe.html" hspace=1 vspace=1>
12、外補(bǔ)白屬性:
語(yǔ)法:marginheight=# marginwidth=#
說(shuō)明:該屬性指定浮動(dòng)幀的邊界大小。取值為正整數(shù)和0,單位為像素。兩個(gè)屬性應(yīng)同時(shí)應(yīng)用。
marginheight:浮動(dòng)幀的左右邊界大小;
marginwidth:浮動(dòng)幀的上下邊界大小。
示例:<iframe src="iframe.html" marginheight=1 marginwidth=1>
——iframe使用語(yǔ)法
<!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)