w3resource

HTML frameborder attribute

frameborder

The purpose of the HTML frameborder attribute is to specify whether or not to display a border around a frame.

The value of this attribute can be set to “1” or “0”.

Supported elements

HTML frameborder attribute supports frame and iframe elements.

Syntax

<frame frameborder="value" >.....</frame>

Type of value

1 or 0.

Value

Value Description
1 To display a border around the frame / iframe. Default value.
0 Not to display a border around the frame/ iframe.

Default value

1

Supported doctypes

HTML 4.01 frameset.

Example of HTML frameborder attribute with frame

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Example of HTML frameborder attribute with frame</title>
</head>
<frameset cols="20%,*,20%">
  <frame src="frame_left.htm" frameborder="0" />
  <frame src="frame_center.htm" frameborder="0" />
  <frame src="frame_right.htm" frameborder="0" />
</frameset>
</html>

Result

html frameborder attribute with frame

View this example in a separate browser window

Example of HTML frameborder attribute with frame

Example of HTML frameborder attribute with iframe

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Example of HTML frameborder attribute with iframe</title>
</head>
<body>  
<iframe src="frame_left.htm" frameborder="0"></iframe>
</body>
</html>

Result

html frameborder attribute with iframe

View this example in a separate browser window

Example of HTML frameborder attribute with iframe

Previous: HTML frame attribute
Next: HTML headers attribute