w3resource logo


HTML frame tag and element - HTML tutorials

HTML frame tag and element

Secondary Nav

Description

1. HTML frame element defines a subwindow.

2. frame element starts with <frame> tag and ends with </frame> tag which is forbidden.

3. The value of the src attribute of the frame element sets the initial value of the document the frame will contain.

4. A number of frames (subwindows) can be defined within frameset element.

5. Usage of frame element is largely replaced by iframe element in modern design techniques.

Syntax

<frame src="document">

Whether both start and end tags are required

The start tag is required but the end tag is forbidden.

Can contain

HTML frame element can contain a web document.

Can reside within

HTML frame element can reside within frameset element.

Attributes

name, longdesc, src, noresize, scrolling, frameborder, marginwidth, marginheight.

Identifiers

id, class.

Title

Title.

Style

Style.

Supported doctypes

HTML 4.01 frameset.

Example of using HTML frame element

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/framset.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>HTML frame tag example - HTML tutorial | w3resource</title>
</head>
<frameset rows="33%,*,33%">
<frame src="../../html/attributes/header.html">
<frame src="../../html/attributes/content.html">
<frame src="../../html/attributes/footer.html">
</frameset>
</html>

Result

htnl frame element

View this example in a separate browser window

HTML frame tag example.



Join our Question Answer community to learn and share your programming knowledge.