如何包含PHP头并将css文件链接到它


How to include PHP header and link css files to it?

我知道我们实际上可以使用PHP来dd我们的页眉/页脚/导航栏。我添加了它,它工作得很好,但我不知道如何添加它的相关样式表。我应该只链接到其 HTML 文件中的页眉和页脚文件吗?喜欢标题.php和链接标题.css到它?

将头文件包含在您想要的任何位置。

<?php
   include 'header.php';
?>

和标题内部.php

<link rel="stylesheet" type="text/css" href="header.css">

href="标头的完整路径.css"

要在标题标签中添加指向 php 页面的样式表链接:

<link rel="stylesheet" href="main.css" type="text/css">