我正在尝试仅使用 html5 和 css3 为学校编写一个学生网站。我想展示我在我的学生网站内的 iFrame 中制作的所有网站,仅使用本地文件但它不加载任何内容。这是我正在使用的代码:
<iframe src="yoga/ch7/index.html" name="frame"></iframe>
<p>
<a href="yoga/ch7/index.html" target="frame"><span>Home</span></a>
<a href="yoga/ch7/classes.html" target="frame"><span>Classes</span></a>
<a href="yoga/ch7/schedule.html" target="frame"><span>Schedule</span></a>
</p>
这就是我所看到的: Screenshot
最佳答案
我试过你的代码,它在我的电脑上工作,请确保 src="url"是正确的。
将它复制并粘贴 (yoga/ch7/index.html) 在您的浏览器中并确保有结果
关于html - 使用 iFrame 加载本地 html 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58184077/