如何在 HTML 中创建子窗口?
htmlweb developmentfront end technology更新于 2025/8/15 17:16:17
使用 <frame> 标签创建子窗口。HTML <frame> 标签用于指定框架集标签内的每个框架。
注意 − HTML5 不支持此标签。请勿使用。
以下是 − 的属性
| 属性 | 值 | 描述 |
|---|---|---|
| Frameborder | 0 or 1 | 指定是否显示框架周围的边框。 |
| Marginheight | pixels | 允许您指定框架边框左右两侧与框架内容之间的间距。该值以像素为单位。例如,marginwidth = "10"。 |
| Marginwidth | pixels | 指定框架内容与其左右边距之间的边距(以像素为单位)。 |
| Name | frame name | Name of the frame. |
| Noresize | noresize | 当设置为 noresize 时,用户无法调整框架大小 |
| Scrolling | yes no auto | 确定滚动条操作。 |
| Src | URL | 框架内容文件的位置。 |
示例
您可以尝试运行以下代码来创建子窗口 −
<!DOCTYPE html> <html> <head> <title>HTML frame Tag</title> </head> <frameset cols = "200, *"> <frame src = "/html/menu.htm" name = "menu_page" /> <frame src = "/html/main.htm" name = "main_page" /> <noframes> <body> Your browser does not support frames. </body> </noframes> </frameset> </html>
相关文章
有用资源
html 参考教程 - 该教程包含有关 html 的更多信息:https://www.cainiaomax.com/html/

