代码Igniter简单基础url css [英] Code Igniter simple base url css

查看:129
本文介绍了代码Igniter简单基础url css的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将我的外部css连接到网页。 css放置在 C:\wamp\www\QBCI\Style\syle.css 和我使用autoload帮助 $ autoload ['helper'] = array(html,form,url);



像这样< link href =<?php echo base_url();?> Style / style.csstype =text / css =stylesheet/& c $ c>现在这里是视图

 < html> 
< head>
< link href =<?php echo base_url();?> style / style.csstype =text / css
rel =stylesheet/&
< / head>

< body>

< div class =header>
http:// localhost / QBCI / // i回显了base_url()
< / div>

< div class =content>


< / div>



< / body>



base url at config.php
$ config ['base_url'] ='http:// localhost / QBCI';





为什么style.css没有加载?我做错了什么?



解决了,我做了css文件syle.css而不是style.css对不起,谢谢你的支持


解决方案

尝试

  link href =<?php echo base_url('style / style.css');?> type =text / css =stylesheet/> 

确保您的 .htaccess style / 目录位于正确的位置(在大多数情况下在 index.php 的同一文件夹中)。



当您使用子文件夹( QBCI )时,请确保您已在 .htaccess 重写路径中。 / p>

i want to connect my external css into the page. the css placed on C:\wamp\www\QBCI\Style\syle.css and i am using autoload helper $autoload['helper'] = array("html","form","url");

so, i write the css connector like this <link href="<?php echo base_url(); ?>Style/style.css" type="text/css" rel="stylesheet" /> and now here is the view

<html>
<head>
    <link href="<?php echo base_url(); ?>style/style.css" type="text/css" 
rel="stylesheet" />
</head>

<body>

    <div class ="header">
        http://localhost/QBCI/  //i was echoing base_url() 
    </div>

    <div class ="content">


    </div>



</body>

and finally, here is my base url at config.php $config['base_url'] = 'http://localhost/QBCI';

why is the style.css is not loaded ? what did i do wrong ?

solved, i made the css file "syle.css" instead of "style.css" sorry guys, thank you for your support

解决方案

Try

<link href="<?php echo base_url('style/style.css'); ?>" type="text/css" rel="stylesheet" />

Make sure your .htaccess works and your style/ directory is in the right place (in the same folder with index.php in most cases).

As you are using a subfolder (QBCI), make sure you have it in your .htaccess rewrite path.

这篇关于代码Igniter简单基础url css的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆