HTML代码简介(2)

2016-02-19 17:03 0 1 收藏

有一种朋友不在生活里,却在生命力;有一种陪伴不在身边,却在心间。图老师即在大家的生活中又在身边。这么贴心的服务你感受到了吗?话不多说下面就和大家分享HTML代码简介(2)吧。

【 tulaoshi.com - Web开发 】

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

  档案型态声明 !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=#

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

(本文来源于图老师网站,更多请访问https://www.tulaoshi.com/webkaifa/)

  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、边框颜色:

(本文来源于图老师网站,更多请访问https://www.tulaoshi.com/webkaifa/)

  语法: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)

来源:https://www.tulaoshi.com/n/20160219/1613975.html

延伸阅读
标签: Web开发
记得以前贴过一个ubb代码转换为html格式的代码,前几天读ubb的源代码。所以有了这个新的版本。注意,这个版本可能还不能正常使用,详细见注。 这段代码将用户输入的ubb代码转化为html格式,注意,需要Script Engine 5.0的支持(使 用了RegExp对象) 注:pattern中使用()将知道regexp记忆搜索到的值,$1是第一个(),其余类推。但$2的 语法并不被...
标签: Web开发
textarea的value是html文件源代码,如何把源代码存成html文件??      如      html      head      meta   http-equiv="Content-Type"   content="text/html;   charset=gb2312" &...
标签: Web开发
如果你是一个喜欢什么都用div来标签的人,那么这个教程一定很适合你.在这个教程里着重讲如何规范的来写HTML代码让它更加的有意义.你有没有经历过这样的场景:在编缉别人的模版时发现那些语意不明的标签,你的感觉是什么样子的.学完这个教程后你会发现规范的代码不仅仅为你以后修改代码省下时间,特别是当你调试一个大的项目时你会发现,原来规范代...
标签: Web开发
script function toScript(val) {  var value = val.value  value  = value.replace(/\\/gi,"\\\\").replace(/"/gi,"\\\"").replace(/'/gi,"\\\'")  valArr = value.split("\r\n")  value=""  for (i=0; ivalArr.length; i++)  {   value += (i==0) ? "info =" : ""   value += "  \"" + va...
标签: PHP
<?php echo <<< EOT                  <table width=80% border="2" cellpadding="3" cellspacing="0" bordercolor="#808080"                 <tr bgcolor="#84A9...

经验教程

679

收藏

79

精华推荐

转换html代码子程序

转换html代码子程序

每每我爱正能量

SEO基础: 合法有效的HTML代码

SEO基础: 合法有效的HTML代码

小怪兽mylove

将html转成ubb代码的正则

将html转成ubb代码的正则

被腐蚀的青春

微博分享 QQ分享 QQ空间 手机页面 收藏网站 回到头部