全新的html/css,有没有办法管理网站上的重复元素,比如工具栏?例如,如果我有一个包含10个页面的网站并想要更改通用工具栏的HTML,我是否必须在所有10个页面上更改它?
最简单的方法是服务器端包含.
意思是,你有:
在index.php你看来像:
<?php include_once "head.php"; ?>
Actual content here
<?php include_once "footer.php"; ?>
Run Code Online (Sandbox Code Playgroud)
head.php 例如,看起来像:
<!doctype HTML>
<html>
<head>
<title>Hello</title>
<?php include_once "nav.php"; ?>
</head>
<body>
Run Code Online (Sandbox Code Playgroud)