HTML5包含文件 [英] HTML5 include file
本文介绍了HTML5包含文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在HTML5中构建一个网站,并希望将nav中的内容一个单独的文件并包含在网站页面中。
解决方案
使用 object 标记:
< object name =footype =text / htmldata =foo.inc>< / object>
foo.inc应该包含有效的HTML。
<注意:不要使用自闭
< object />
样式。这将阻止标签显示后的内容。 What is the best way - cross browser compatible to include an HTML file in HTML5.
I am building a site in HTML5 and would like to have the nav in one separate file and included in the site pages.
解决方案
Use the object tag:
<object name="foo" type="text/html" data="foo.inc"></object>
foo.inc should include valid HTML.
Note: do NOT use the self-closing <object/>
style. That will prevent content after the tag from being displayed.
这篇关于HTML5包含文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文