当前位置:首页 > 代码 > 正文

关于显示框架的html代码的信息

admin 发布:2022-12-19 21:24 149


本篇文章给大家谈谈显示框架的html代码,以及对应的知识点,希望对各位有所帮助,不要忘了收藏本站喔。

本文目录一览:

html中框架(frame)的详细使用方法

框架概念 :

所谓框架便是网页画面分成几个框窗,同时取得多个 URL。只 要 FRAMESET FRAME 即可,而所有框架标记 要放在一个总起的 html 档,这个档案只记录了该框架 如何划分,不会显示任何资料,所以不必放入 BODY 标记,浏览这框架必须读取这档 案而不是其它框窗的档案。FRAMESET 是用以划分框窗,每一框窗由一个 FRAME 标 记所标示,FRAME必须在 FRAMESET 范围中使用。如下例:

frameset cols="50%,*"

frame name="hello" src="up2u.html"

frame name="hi" src="me2.html"

/frameset

此例中 FRAMESET 把画面分成左右两相等部分,左便是显示 up2u.html,右边则会显示 me2.html 这档案,FRAME 标记所标示的框窗永远是按由上而下、由左至右的次序。

FRAMESET FRAME :

FRAMESET 称框架标记,用以宣告HTML文件为框架模式,并设定视窗如何分割。

FRAME 则只是设定某一个框窗内的参数属性。

FRAMESET 参数设定:

例子:frameset rows="90,*" frameborder="0" border=0 framespacing="2" bordercolor="#008000"

COLS="90,*"

垂直切割画面(如分左右两个画面),接受整数值、百分数, * 则代表占用馀下空 间。数值的个数代表分成的视窗数目且以逗号分隔。例如 COLS="30,*,50%" 可以 切成三个视窗,第一个视窗是 30 pixels 的宽度,为一绝对分割,第二个视窗是当 分配完第一及第三个视窗后剩下的空间,第三个视窗则占整个画面的 50% 宽度 为 一相对分割。您可自己调整数字。

ROWS="120,*"

就是横向切割,将画面上下分开,数值设定同上。唯 COLS 与 ROWS 两参数尽量 不要同在一个 FRAMESET 标记中,因 Netacape 偶然不能显示这类形的框架,尽 采用多重分割。

frameborder="0"

设定框架的边框,其值只有 0 和 1 , 0 表示不要边框, 1 表示要显示边框。(避 免使用 yes 或 no )

border="0"

设定框架的边框厚度,以 pixels 为单位。

bordercolor="#008000"

设定框架的边框颜色。

framespacing="5"

表示框架与框架间的保留空白的距离。

FRAME 参数设定:

例子:frame name="top" src="a.html" marginwidth="5" marginheight="5" scrolling="Auto" frameborder="0" noresize framespacing="6" bordercolor="#0000FF"

SRC="a.html"

设定此框窗中要显示的网页档案名称,每个框窗一定要对应著一个网页档案。你可 使用绝对路径或相对路径,有关此两者详见於【连结进阶】。

NAME="top"

设定这个框窗的名称,这样才能指定框架来作连结,必须但任意命名。

frameborder=0

设定框架的边框,其值只有 0 和 1 , 0 表示不要边框, 1 表示要显示边框。(避 免使用 yes 或 no )

framespacing="6"

表示框架与框架间的保留空白的距离。

bordercolor="#008000"

设定框架的边框颜色。颜色值请参考【HTML 剖析】。

scrolling="Auto"

设定是否要显示卷轴,YES 表示要显示卷轴,NO 表示无论如何都不要显示, AUTO是视情况显示。

noresize

设定不让使用者可以改变这个框框的大小,亦没有设定此参数,使用者可以很随 意地拉动框架,改变其大小。

marginhight=5

表示框架高度部份边缘所保留的空间。

marginwidth=5

表示框架宽度部份边缘所保留的空间。

NOFRAMES :

当别人使用的浏览器太旧,不支援框架这个功能时,他看到的将会是一片空白。为了避免 这种情况,可使用 NOFRAMES 这个标记,当使用者的浏览器看不到框架时,他就会看 到 NOFRAMES 与 /NOFRAMES 之间的内容,而不是一片空白。这些内容可以是提醒 浏览转用新的浏览器的字句,甚至是一个没有框架的网页或能自动切换至没有框架的版本 亦可。

应用方法:

在frameset 标记范围加入 /NOFRAMES 标记,以下是一个例子:

frameset rows="80,*"

noframes

body

很抱歉,馈下使用的浏览器不支援框架功能,请转用新的浏览器。

/body

/noframes

frame name="top" src="a.html"

frame name="bottom" src="b.html"

/frameset

若浏览器支援框架,那堋它不会理会 noframes 中的东西,但若浏览器不支援框架,由 於不认识所有框架标记,不明的标记会被略过,标记包围的东西便被解读出来,所以放在 noframes范围内的文字会被显示。

IFRAME :

这标记只适用於 IE。 它的作用是在一页网页中间插入一个框窗以显示另一个文件。它是 一个围堵标记,但围著的字句只有在浏览器不支援 iframe 标记时才会显示,如noframes 一样,可以放些提醒字句之类。通常 iframe 配合一个辨认浏览器的 Java Script 会较好,若 JavaScript 认出该浏览器并非 Internet Explorer 便会切换至另一版本。

iframe 的参数设定如下:

例子: iframe src="iframe.html" name="test" align="MIDDLE" width="300" height="100" marginwidth="1" marginheight="1" frameborder="1" scrolling="Yes"

src="iframe.html"

欲显示於此框窗的文件来源除档案名称,必要加上相对或绝对路径。

name="test"

此框窗名称,这是连结标记的 target 参数所 要的,

align="MIDDLE"

可选值为 left, right, top, middle, bottom,作用不大

width="300" height="100"

框窗的宽及长,以 pixels 为单位。

marginwidth="1" marginheight="1"

该插入的文件与框边所保留的空间。

frameborder="1"

使用 1 表示显示边框, 0 则不显示。(可以是 yes 或 no)

scrolling="Yes"

使用 Yes 表示容许卷动(内定), No 则不容许卷动。

例子: 原始码

center iframe src="" name="test" align="MIDDLE" width="300" height="100" marginwidth="5" marginheight="5" frameborder="1"

很抱歉,馈下使用的浏览器并不支援 IFrame,不能正常浏览我的网页。/iframe

/center

frameset参数传递问题

左边的条件参数如何传,右边才能接收

--------------------------------------------------------------------------------

对三个帧分别命名为:left.asp(显示查询条件的页面,其中帧名为:left),top.asp,main.asp(显示查询结果的页面,其中帧名为:main)

如:

html

head

meta http-equiv="Content-Type" content="text/html; charset=gb2312"

titlesearch/title

/head

frameset rows="80,*" frameborder="NO" border="0" framespacing="0"

frame src="top.asp" name="top" scrolling="NO" noresize

frameset cols="80,*" frameborder="NO" border="0" framespacing="0"

frame src="left.asp" name="left" scrolling="NO" noresize

frame src="main.asp" name="main"

/frameset

/frameset

noframesbody

/body/noframes

/html

在left的表单中写成:

form name="form1" method="post" action="main.asp" target="main"

......//你自己设计吧。

/form

这样就可以你的查询条件传给main.asp中了!

如何设置HTML代码中的“框架”

框架main.html代码:html

head

meta http-equiv="Content-Type" content="text/html; charset=gb2312" /

titlemain/title

/headframeset rows="80,*" frameborder="no" border="0" framespacing="0"

frame src="topframe.html" name="topFrame" scrolling="No" noresize="noresize" id="topFrame" title="topFrame" /

frame src="mainframe.html" name="mainFrame" id="mainFrame" title="mainFrame" /

/frameset

noframesbody

/body

/noframes/html

框架页面topframe.html代码:html

head

meta http-equiv="Content-Type" content="text/html; charset=gb2312" /

titletopframe/title

/headbody

a target="_parent" href="main.html"reset/a

/body

/html

网页设计常用HTML代码

网页设计常用HTML代码大全

HTML是用来描述网页的一种语言。下面我为大家分享HTML代码,希望对大家学习html代码有帮助!

忽视右键

body oncontextmenu="return false"

body style="overflow-y:hidden"

1.如何几秒后转到别的页面?

META HTTP-EQUIV="Refresh" CONTENT="时间;URL=地址"

2.点击关闭窗口

a href="javascript:top.window.close();"点击关闭窗口/a!

3.请问如何去掉主页右面的滚动条?

body scroll="no"

body style="overflow-y:hidden"

4.请问如何做到让一个网页自动关闭.

html

head

OBJECT id=closes type="application/x-oleobject" classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11"

param name="Command" value="Close"

/object

/head

body onload="window.setTimeout(‘‘‘‘closes.Click()‘‘‘‘,10000)"

这个窗口会在10秒过后自动关闭,而且不会出现提示. /body

如何在不刷新页面的情况下刷新css?

style

button{ color:#000000;}

/style

button onclick=document.styleSheets[0].rules[0].style.color=‘‘‘‘red‘‘‘‘点击按钮直接修改style标签里button选择符使按钮改为红色/button

请问如何让网页自动刷新?

在head部记入META HTTP-EQUIV="Refresh" content="20"其中20为20秒后自动刷新,你可以更改为任意值。

5.如何让页面自动刷新?

方法一,用refresh

HTML 代码片段如下:

head

meta http-equiv="refresh" content="5"

/head

5表示刷新时间

[Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]

方法二,使用setTimeout控制

img src=/logo.gif

script

function rl(){

document.location.reload()

}

setTimeout(rl,2000)

/script

6.如何让超链接没有下划线

在源代码中的HEAD…/HEAD之间输入如下代码:

style type="text/css" !--

a { text-decoration: none}

-- /style

7.请问如何去掉IE的上下滚动条?

body style=‘‘‘‘overflow:scroll;overflow-y:hidden‘‘‘‘

/body

8.怎样才能把RealPlayer文件在网页做一个试听连接?

embed height=25 src=51js.rm type=audio/x-pn-realaudio-plugin width=50 autostart="false" controls="PlayButton"

9.如何用html实现浏览器上后退按钮的功能?

a href="java script:history.go(-1)"点击后退/a

或者

script history.back() /script

10.请问怎么在网页中改变鼠标的箭头形状?

HTML 代码片段如下:

body

a href="#" style="cursor: auto;"auto/abr

a href="#" style="cursor: crosshair "crosshair /abr

a href="#" style="cursor: default "default /abr

a href="#" style="cursor: hand "hand /abr

a href="#" style="cursor: move "move /abr

a href="#" style="cursor: e-resize "e-resize /abr

a href="#" style="cursor: ne-resize "ne-resize /abr

a href="#" style="cursor: nw-resize"nw-resize/abr

a href="#" style="cursor: n-resize"n-resize/abr

a href="#" style="cursor: se-resize"se-resize/abr

a href="#" style="cursor: sw-resize"sw-resize/abr

a href="#" style="cursor: s-resize"s-resize/abr

a href="#" style="cursor: w-resize"w-resize/abr

a href="#" style="cursor: text"text/abr

a href="#" style="cursor: wait"wait/abr

a href="#" style="cursor: help"help/abr

/body

11.怎样不使用页面的缓存?即每一次打开页面时不是调用缓存中的东西

META HTTP-EQUIV="Pragma" CONTENT="no-cache"

12.页面打开时自动弹出一个窗口的代码怎么写?

HTML 代码片段如下:

html

head

titleUntitled Document/title

meta http-equiv="Content-Type" content="text/html; charset=gb2312"

script language="B style="color:black;background-color:#A0FFFF"javascript/B"

!--

function MM_openBrWindow(theURL,winName,features) { //v2.0

window.open(theURL,winName,features);

}

//--

/script

/head

body bgcolor="#FFFFFF" text="#000000" onLoad="MM_openBrWindow(‘‘‘‘‘‘‘‘,‘‘‘‘,‘‘‘‘width=400,height=400‘‘‘‘)"

/body

/html

13.如何让我的页面出现一个会讲话的小人?Merlin

HTML 代码片段如下:

HTML

HEAD

TITLE默林/TITLE

META http-equiv=Content-Type content="text/html; charset=gb2312"

/HEAD

BODY

pOBJECT id=sims classid=CLSID:D45FD31B-5C6E-11D1-9EC1-00C04FD7081F

/OBJECT

SCRIPT

var MerlinID;

var MerlinACS;

sims.Connected = true;

MerlinLoaded = LoadLocalAgent(MerlinID, MerlinACS);

Merlin = sims.Characters.Character(MerlinID);

Merlin.Show();

Merlin.Play("Surprised");

Merlin.Speak("大家好");

Merlin.Play("GestureLeft");

Merlin.Think("我是默林!");

Merlin.Play("Pleased");

Merlin.Think("可爱吗?");

Merlin.Play("GestureDown");

Merlin.Speak("哈哈!");

Merlin.Hide();

function LoadLocalAgent(CharID, CharACS){

LoadReq = sims.Characters.Load(CharID, CharACS);

return(true);

}

/SCRIPT

/p

p /p

p看此效果必须装有office2000!!!/p

/BODY

/HTML

14.在页面中如何加入不是满铺的背景图片,拉动页面时背景图不动

HTML 代码片段如下:

htmlhead

STYLE

body  {background-image:url(logo.gif);

background-repeat:no-repeat; background-position:center }

/STYLE

/head

body bgproperties="fixed"

/body

/html

[Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]

background-repeat:no-repeat; 是让背景图不占满整个页面

body bgproperties="fixed" 是拉动scroll时背景图不动

15.文本输入框什么属性能实现不可输入?

HTML 代码片段如下:

input type="text" name="textfield" disabled

或者

input type="text" name="textfield" readonly

16.如何禁止自己的页面在别人的框架里打开?

把以下代码加至你的head区

script

if (window.top!=self){

window.top.location=self.location

}

/script

17.如何实现首页全屏幕显示?

HTML 代码片段如下:

html

bodyscript language="B style="color:black;background-color:#A0FFFF"javascript/B"

var coolw=642

var coolh=400

var coolhuang=window.open("","coolhuang","width="+coolw+",height="+coolh+",

fullscreen=1,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0")

window.close()

/script/body/html

18.如何监听一个窗口被关闭了?

HTML 代码片段如下:

body onunload="alert(‘‘‘‘你关闭了这个窗口‘‘‘‘)"

19.如何禁止Ctrl+N?

HTML 代码片段如下:

body onkeydown=return(!(event.keyCode==78event.ctrlKey))

如何把页面加入用户的收藏夹?

HTML 代码片段如下:

a href="B style="color:black;background-color:#A0FFFF"javascript/B:window.external.AddFavorite(‘‘‘‘‘‘‘‘,‘‘‘‘无忧脚本‘‘‘‘)"收藏无忧脚本/a

如何在我的'页面中加入背景音乐?

IE: bgsound src="*.mid" loop=infinite

NS:embed src="*.mid" autostart=true hidden=true loop=true

*.mid你的背景音乐的midi格式文件

关于页面转换效果

meta http-equiv="page-enter" content="revealTrans(Duration=4,Transition=23)"

meta http-equiv="page-exit" content="revealTrans(Duration=4,Transition=23)"

说明:Transition=23是随机效果,另可以选0-22任一数字固定某个效果

如何设定打开页面的大小

HTML 代码片段如下:

body onload="top.resizeTo(300,200);"!--(width,height)--

怎样双击滚屏,单击停止?

HTML 代码片段如下:

html

head

title新网页1/title

/head

body

script language"B style="color:black;background-color:#A0FFFF"javascript/B"

var currentpos,timer;

function initialize()

{

timer=setInterval("scrollwindow()",10);

}

function sc(){

clearInterval(timer);

}

function scrollwindow()

{

currentpos=document.body.scrollTop;

window.scroll(0,++currentpos);

if (currentpos != document.body.scrollTop)

sc();

}

document.onmousedown=sc

document.ondblclick=initialize

/script

pa/ppa/ppa/ppaa/ppaa/ppaa/p

paa/ppaa/ppaa/ppaa/ppaa/ppaa/p

paa/ppaa/ppaa/ppaa/ppaa/ppaa/p

paa/ppaa/ppaa/ppaa/ppa/p

/body

/html

如何让body中的文字不被选中?

HTML 代码片段如下:

body onselectstart="return false" aaa/body

如何让弹出的窗口不能关闭?

在新开的窗口中加入如下代码

body onunload=open(location.href)

/body

如何让浏览器在保存页面时保存失败?

HTML 代码片段如下:

NOSCRIPT

B style="color:black;background-color:#ffff66"IFRAME/B SRC="*.html"

/B style="color:black;background-color:#ffff66"IFRAME/B

/NOSCRIPT

表单中如何用图片按钮实现 reset?

html

head

script

function aaa(){

document.forms[0].reset()

}

/script

/head

body

form

textarea rows="2" name="S1" cols="20"/textarea

input type="submit" values="提交" name="B1"

image src="logo.gif" onclick=aaa()

/form

/body/html

进入网页时弹出的信息对话框

body onLoad="window.alert(‘‘‘‘欢迎光临本站‘‘‘‘)"

关闭窗口后弹出对话框

body onUnload="window.alert(‘‘‘‘谢谢你的光临!欢迎下次再来!‘‘‘‘)"

告别提示

body onUnload= alert("再见,感谢你的访问!")

右键菜单的制作

OBJECT id=menu type="application/x-oleobject" classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11"

PARAM name="Command" value="Related Topics,menu"

PARAM name="Item1" value="动易;"

PARAM name="Item2" value="搜狐;"

PARAM name="Item3" value="新浪;"

PARAM name="Item4" value="网易;"

PARAM name="Item5" value="互动学院;"

/OBJECT script if (document.all) document.body.onmousedown=new Function("if (event.button==2) menu.Click();") /script

下拉菜单

object id=HHCtrl type="application/x-oleobject" classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11" PARAM name="Command" value="Related Topics,Menu" PARAM name="Item1" value="aspease;" PARAM name="Item2" value="byhu;" PARAM name="Item3" value="lzz;" /object a href=javascript:HHCtrl.Click() title="下拉菜单"下拉菜单/a

;

显示框架的html代码的介绍就聊到这里吧,感谢你花时间阅读本站内容,更多关于、显示框架的html代码的信息别忘了在本站进行查找喔。

版权说明:如非注明,本站文章均为 AH站长 原创,转载请注明出处和附带本文链接;

本文地址:http://ahzz.com.cn/post/24896.html


取消回复欢迎 发表评论:

分享到

温馨提示

下载成功了么?或者链接失效了?

联系我们反馈

立即下载