HTML frame Tag

HTML <frame> Tag

Example

A simple three-framed page:

<html>

<frameset cols="25%,50%,25%">
  <frame src="frame_a.htm" />
  <frame src="frame_b.htm" />
  <frame src="frame_c.htm" />
</frameset>

</html>

Try it yourself »
(more examples at the bottom of this page)

Definition and Usage

The <frame> tag defines one particular window (frame) within a frameset.

Each frame in a frameset can have different attributes, such as border, scrolling, the ability to resize, etc.


Browser Support

The <frame> tag is supported in all major browsers.


Differences Between HTML and XHTML

In HTML, the <frame> tag has no end tag. In XHTML, the <frame> tag must be properly closed.

In XHTML, the name attribute of the <frame> tag is deprecated, and will be removed. Use the id attribute instead.


Tips and Notes

Note: If you want to validate a page containing frames, be sure the doctype is set to "Frameset DTD". Read more about doctypes.

Important: You cannot use the body element together with the frameset element. However, if you add a <noframes> tag containing some text for browsers that do notsupport frames, you will have to enclose the text in a body element.


Optional Attributes

DTD indicates in which HTML 4.01/XHTML 1.0 DTD the attribute is allowed. S=Strict, T=Transitional, and F=Frameset.

AttributeValueDescriptionDTD
frameborder0
1
Specifies whether or not to display a border around a frameF
longdescURLSpecifies a page that contains a long description of the content of a frameF
marginheightpixelsSpecifies the top and bottom margins of a frameF
marginwidthpixelsSpecifies the left and right margins of a frameF
namenameSpecifies the name of a frameF
noresizenoresizeSpecifies that a frame cannot be resizedF
scrollingyes
no
auto
Specifies whether or not to display scrollbars in a frameF
srcURLSpecifies the URL of the document to show in a frameF


Standard Attributes

The <frame> tag supports the following standard attributes:

AttributeValueDescriptionDTD
classclassnameSpecifies a classname for an elementF
ididSpecifies a unique id for an elementF
stylestyle_definitionSpecifies an inline style for an elementF
titletextSpecifies extra information about an elementF

More information about Standard Attributes.


Event Attributes

According to the W3C, the <frame> tag does not support any event attributes.

However, the onload event is supported in all browsers.

More information about Event Attributes.


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值