[英]Reference CSS file in my includes/header.php
I have a header.php
file that is called in all the pages. 我有在所有页面中调用的header.php
文件。 This header file contains a menu bar. 该头文件包含一个菜单栏。 The menu bar has been modified and the new item includes opening a pop-up div on click. 菜单栏已被修改,新项目包括在单击时打开一个弹出div。 This div reference a few css
and javascript
files. 该div参考了一些css
和javascript
文件。 How can I add these files to the header considering I cannot have a head
tag in the header.php
file. 考虑到header.php
文件中没有head
标签,如何将这些文件添加到header中。 The solution that has failed to work is: 无效的解决方案是:
<style>
<?php include '../../css/base.css'; ?>
</style>
Link to an external CSS and Javascript file, they don't need to be in the <head>
section. 链接到外部CSS和Javascript文件,它们不必位于<head>
部分。
To add css use 添加css使用
<link rel="stylesheet" type="text/css" href="path/to/your/css/file">
To add javascript 添加JavaScript
<script src="path/to/your/js/file"></script>
用这个
<link rel="stylesheet" type="text/css" media="screen" href="../../css/base.css">
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.