如何在PHP项目中设置CSS地址文件?

编程入门 行业动态 更新时间:2024-10-24 07:23:36
本文介绍了如何在PHP项目中设置CSS地址文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 嗨 我想为我的网站使用布局. 我在其中有布局文件夹,我有header.php和footer.php 在此标头中,从css文件夹调用css文件

<?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">

但是这个地址不起作用:(

解决方案

root_dir = dirname(__ DIR __);?> < link href =<?php echo echo /blockquote>

root_dir ."design/css/bootstrap. min .css";?>"rel ="stylesheet" type ="text/css"> < 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地址文件?

本文发布于:2023-07-16 20:18:54,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1125502.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:地址   文件   项目   如何在   PHP

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!