如何在另一个html文件中包含html文件 [英] How to include html file in another html file

查看:119
本文介绍了如何在另一个html文件中包含html文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个html文件 first.html second.html ,我想将第二个文件包含到第一个用于代码可用性的文件。我使用以下语句来包含文件:

I have two html files first.html and second.html and I want to include the second file into the first file for code re usability. I am using following statement to include the file:

<link rel="import" href="html file name here">

但它不起作用。我尝试过使用其他解决方案,但都没有成功。

But it is not working. I tried using another solutions too, but none of them worked.

所以给出任何建议。

So give any suggestion.

推荐答案

看看这个网站。
http://www.html5rocks.com/en/tutorials/webcomponents/进口/

它表明最佳做法是什么。
它总是取决于你的真实需求。为什么你没有使用框架?

It suggest what are the best practices. It always depends on your real needs. Why you didn't use frames?

这篇关于如何在另一个html文件中包含html文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆