To create a frame in HTML, you can use the `<iframe>` tag, which allows you to embed another HTML page within your current page. Here’s a basic example of how to create a frame using HTML:
```html
<!DOCTYPE html>
<html>
<head>
<title>Iframe Example</title>
</head>
<body>
<h1>Main Page</h1>
<iframe src="https://www.example.com" width="600" height="400" frameborder="0">
Your browser does not support iframes.
</iframe>
</body>
</html>
```
In this example:
- The `src` attribute specifies the URL of the page to be embedded.
- The `width` and `height` attributes set the size of the frame.
- The `frameborder` attribute specifies whether or not to display a border around the frame (0 for no border, 1 for a border).
- The text inside the `<iframe>` tag will be displayed if the browser does not support iframes.
Save this code in an `.html` file and open it in a web browser to see the frame in action.
No comments:
Post a Comment