1.使用 iframe 標(biāo)簽
<iframe src="../../publish.html" scrolling="no" frameborder="0" style="width: 100%;height: 1500px"></iframe>
src:你要導(dǎo)入的html
scrolling:? 是否開(kāi)啟滾屏
frameborder:?是否設(shè)置邊框
style:設(shè)置樣式文章來(lái)源:http://www.zghlxwxcb.cn/news/detail-610444.html
2.使用jQ的load
$("#page1").load("../../publish.html");
獲取某個(gè)div的id或者class調(diào)用load方法 里面填寫(xiě)要嵌套html的路徑就可以了文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-610444.html
到了這里,關(guān)于html嵌套html的兩種方法( iframe,load)的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!