Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
假设我有一个导航栏,我想在所有页面上使用它,这样我就可以轻松地编辑一次并在所有页面上更新它,而不是单独更改每个页面。我怎么能这样做?
我会在另一个 html 文档中创建它并将元素链接到每个页面吗?
您可以使用<?php include ('filename.php') ?>在多个页面上包含相同的代码块。
<?php include ('filename.php') ?>