如何使用 PHP 代码而不是 HTML 代码导入/包含 CSS 文件?

2021-12-25 00:00:00 import php html css

我在谷歌上搜索了很多,但似乎我做错了什么.

I have googled a lot but it seems that I am doing something wrong.

我想这样做:

<?php
include 'header.php';
include'CSS/main.css';
...
?>

但是,我的页面打印了 CSS 代码.

However, my page prints the CSS code.

注意:我想使用 PHP 来包含 CSS 文件,而不是使用我还想将我的 CSS 文件重命名为某些网站提到的 PHP 文件.

Note: I want to use PHP to include the CSS file, and not use I also do you want to rename my CSS file to a PHP file as some website mentioned.

有什么线索吗?

非常感谢.

推荐答案

你必须用