写一个含有frameset的多页面网站
时间: 2023-12-17 13:02:25 浏览: 36
好的,以下是一个简单的含有 frameset 的多页面网站示例:
```html
<!DOCTYPE html>
<html>
<head>
<title>Frameset Demo</title>
</head>
<frameset cols="20%,80%">
<frame src="menu.html" name="menu">
<frame src="home.html" name="content">
<noframes>
<body>
<p>Your browser does not support frames.</p>
</body>
</noframes>
</frameset>
</html>
```
解释一下代码:
1. `frameset` 标签用来定义一个框架集,里面可以包含多个 `frame` 标签,用来定义每个框架的内容。
2. `cols` 属性用来定义框架集中各个框架的宽度比例,这里我们定义了两列,第一列占 20%,第二列占 80%。
3. 第一个 `frame` 标签的 `src` 属性为 "menu.html",它的 `name` 属性为 "menu",表示这个框架会加载 "menu.html" 这个页面,并在父窗口中被命名为 "menu"。
4. 第二个 `frame` 标签的 `src` 属性为 "home.html",它的 `name` 属性为 "content",表示这个框架会加载 "home.html" 这个页面,并在父窗口中被命名为 "content"。
5. `noframes` 标签用来定义在不支持框架的浏览器中显示的内容,这里我们只是简单地提示用户浏览器不支持框架。
你可以在 "menu.html" 和 "home.html" 这两个页面中分别添加自己的内容。在 "menu.html" 中,你可以添加一个菜单列表,用来链接到其他页面;在 "home.html" 中,你可以添加网站的首页内容。同时,你也可以添加更多的 frame 标签来定义更多的框架。
相关推荐
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![application/x-rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![txt](https://img-home.csdnimg.cn/images/20210720083642.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)