如何在PHP项目中设置CSS地址文件? [英] How Do I Set Css Address File In Php Projec?
本文介绍了如何在PHP项目中设置CSS地址文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在其中有布局文件夹,我有header.php和footer.php
在此标头中,从css文件夹调用css文件
<?php $ root_dir = dirname(__ DIR __);?>
< link href =<?php $ root_dir ."design/css/bootstrap.< link href ="design/css/blog-home.css" rel ="stylesheet" type ="text/css">
但是这个地址不起作用:(
解决方案
root_dir = dirname(__ DIR __);?> < link href =<?php < link href ="design/css/blog-home.css" rel ="stylesheet" type ="text/css">
但是这个地址不起作用:(
我该如何修复主题?
如果您想使用标题条目,则必须声明< head>实体.一个php文件看起来就像一个HTML文件(即,也有一个正文).链接项至少如图所示,仅在文件中浮动.该文件应包含DOCTYPE和所有内容.
备选:通过php包含FILE.确保< script>标签已适当提供.
hi
i want use layout for my site.
i have layout folder that into it ,i have header.php and footer.php
in this header call css file from css folder
<?php $root_dir=dirname(__DIR__);?>
<link href="<?php echo $root_dir."design/css/bootstrap.min.css";?>" rel="stylesheet" type="text/css">
<link href="design/css/blog-home.css" rel="stylesheet" type="text/css">
but this address not work :(
how can i fix theme?
解决方案
root_dir=dirname(__DIR__);?> <link href="<?php echo
root_dir."design/css/bootstrap.min.css";?>" rel="stylesheet" type="text/css"> <link href="design/css/blog-home.css" rel="stylesheet" type="text/css">
but this address not work :(
how can i fix theme?
If you wish to use header entries, you must declare the <head> entity. A php file can look just like an HTML file (i.e, have a body, too). Your link items are, at least as shown, just floating in a file. The file should include DOCTYPE and all.
Alternative: include the FILE via php. Make sure the <script> tags are appropriately supplied.
这篇关于如何在PHP项目中设置CSS地址文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文