Quackit Logo
$1.99 Domain Names
With every new non-domain purchase thru ZappyHost, you get a domain name for only $1.99.
Create free Flash websites

HTML Frames Code

Print Version

You can use the following HTML code to create a web page split into frames.

You can also check out these HTML frames templates and the HTML Frames page of the HTML Tutorial.

Example HTML Frames Code:

To make frames in HTML, you need 3 or more pages. One page is the frameset page, the other pages are for each individual frame. The following code is for a frameset page. Note the code pointing to 2 other pages - one for the left frame, the other for the right frame.

The frameset page:

<html>
<head>
<title>Frameset page<title>
</head>
<frameset cols = "25%, *">
  <noframes>
  <body>Your browser doesn't support frames.
  Therefore, this is the noframe version of the site.</body>
  </noframes>
  <frame src ="/html/tutorial/frame_example_left.html" />
  <frame src ="/html/tutorial/frame_example_right.html" />
</frameset>
</html>

The left frame (frame_example_left.html):

<html>
<body style="background-color:green">
<p>This is the left frame (frame_example_left.html).</p>
</body>
</html>

The right frame (frame_example_right.html):

<html>
<body style="background-color:yellow">
<p>This is the right frame (frame_example_right.html).</p>
</body>
</html>
View the result

Frame Templates

The frameset tags contain other tags nested within them. These other tags define the actual frames that appear within the document (the frameset document).

You can use the following template as a basis for your HTML frames code. Simply fill in the blanks or remove uneeded attributes.

Since HTML frames code is made up of several tags, each tag is presented separately here.

1. The <frameset> Tag

For an explanation of all the attributes, see the HTML frameset tag specifications.

<frameset
	rows=""
	cols=""
	class=""
	id=""
	title=""
	style=""
	onload=""
	onunload="" >

	(the individual frames go here - see below)

	</frameset>

2. The <frame> Tag

This tag defines each frame within the frameset.

For an explanation of all the attributes, see the HTML frame tag specifications.

<frame
	name=""
	longdesc=""
	src=""
	noresize=""
	scrolling=""
	frameborder=""
	marginwidth=""
	marginheight=""
	class=""
	id=""
	title=""
	style="" />

3. The <noframes> Tag

This tag defines what to display if the browser doesn't support frames.

For an explanation of all the attributes, see the HTML noframes tag specifications.

<noframes
	class=""
	id=""
	title=""
	style=""
	lang=""
	dir=""
	onclick=""
	ondbclick=""
	onmousedown=""
	onmouseup=""
	onmouseover=""
	onmousemove=""
	onmouseout=""
	onkeypress=""
	onkeydown=""
	onkeyup="" >

(content to display if browser doesn't support frames)

</noframes>

Don't forget to check out these HTML frames templates.

Enjoy this website?

  1. Add this page to your Favorites
  2. Link to this page (copy/paste into your own website or blog):
  3. Help support Quackit by making a donation

Oh, and thank you for supporting Quackit!

Need Website Content?
Get unique, quality digital content for your website.
  • 270+ Website Templates
  • 800+ Flash Templates
  • 25,000+ Images, Logos
  • 30,000+ e-Books
  • 15,000+ Scripts
  • 27,000+ Animated GIFs
  • 21,000+ Ringtones
  • ...and much more!
Get your content now!
FREE Hosting!
With every domain you register with ZappyHost you get FREE hosting.
© Copyright 2000 - 2010 Quackit.com