Php css设置在codeigniter中不起作用

Php css设置在codeigniter中不起作用,php,Php,我无法在CodeIgniter中获得CSS设置,生活在我所做的更改之下。有人能帮我吗?哪里错了 文件autoload.php $autoload['helper'] = array('html','text'); 主文件夹控制器中的文件 <?php if (!defined('BASEPATH')) exit('No direct script access allowed'); class Home extends CI_Controller{ public function

我无法在CodeIgniter中获得CSS设置,生活在我所做的更改之下。有人能帮我吗?哪里错了

文件autoload.php

$autoload['helper'] = array('html','text');
主文件夹控制器中的文件

<?php if (!defined('BASEPATH')) exit('No direct script access allowed');

class Home extends CI_Controller{
    public function __construct() {
        parent::__construct();
    }

    public function index(){
        $this->load->view('html_header');
        $this->load->view('cabecalho');
        $this->load->view('corpo');
        $this->load->view('rodape');
        $this->load->view('html_footer');
    }

}

因为它不起作用。

您需要添加类似css的内容(如果css目录位于CI的根目录上)

else(如果css目录位于其他目录下)

有关更多信息,请参见:-
当您使用css时,请尝试ctrl+u或view source is css path is ok

,如第一个:

/css/style.css


css文件夹应该在应用程序之前位于根目录中

没有放置link_标记('css/teste.css')时出现了什么错误;尝试echo link_标记('css/teste.css');
<?php echo doctype('xhtml1-trans'); ?>
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title>Meu website de receitas</title>
        <?php
        $meta = array(
            array('name' => 'robots', 'content' => 'no-cache'),
            array('name' => 'description', 'content' => 'Meu website de receitas'),
            array('name' => 'keywords', 'content' => 'Receitas, doces, salgados, sobremesas, massas'),
            array('name' => 'robots', 'content' => 'no-cache'),
            array('name' => 'Content-type', 'content' => 'text/html; charset=utf-8', 'type' => 'equiv')
        );
        echo meta($meta);

        echo link_tag('caminho/css/teste.css');
        ?>
    </head>
<body>
#cabecalho{background-color: #ddd; float: left; width: 824px; margin-bottom: 10px; padding: 5px;}
echo link_tag('css/teste.css');
   echo link_tag('other/css/teste.css');