如何使用HTML创建母版页? [英] How to create a master page using HTML?

查看:2075
本文介绍了如何使用HTML创建母版页?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个网站,我想在每一页都有一致的风格(标题和侧边菜单)。

I have a website which I want to have a consistent style (a header and a side menu) in every page.

我想为它创建类似于母版页的内容。我不想使用框架。

I want to create something similar to a master page for it. I don't want to use frames.

如何使用HTML,CSS,JavaScript和jQuery实现这一目标?

How could I achieve this using HTML, CSS, JavaScript and jQuery?

推荐答案

您可以使用jQuery Load函数来包含头或菜单html页面,例如,包括一个公共头文件html文件,

you can use jQuery Load function to include header or menu html page, for example, to include a common header html file,

    <div id="new-header">
        <script>
            $("#new-header").load("header.html");
        </script>
    </div>

这篇关于如何使用HTML创建母版页?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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