HTML Element <frame> Example
The HTML element <frame>
is used to define a single frame in a frameset element.
The element <frameset>
can have one or more <frame>
elements, each having its own attributes for borders, ability to scroll, ability to resize, etc.,
This element is not supported in HTML5 and you should avoid using it in the markup. Instead, use the <iframe>
element.
Here is an example that explains the element in action. Click the below link to see the live demo.
<!DOCTYPE html>
<html lang="en">
<head>
<title>Example - HTML Element frame</title>
</head>
<body>
<!-- This elements frame and frameset are obsolete and not valid in HTML5, so avoid using them in your markup -->
<frameset rows="*,*">
<frame src="https://www.randomcodez.com" name="home">
<frame src="https://www.randomcodez.com/about" name="about">
</frameset>
<!-- Alternative and better way is to use iframe element as shown below. -->
<iframe src="https://www.randomcodez.com/about" height="300" width="400"></iframe>
</body>
</html>