CodeIgniter css樣式不顯示問題
這是我的引用css的代碼
<?php echo $title ?> - News
News
這是我的config.php的檔案
$config['base_url']= 'http://127.0.0.1/myPhpStudy/index.php/';
這是產生頁面後的原始碼,點擊href串連顯示404,我懷疑可能路徑錯誤,可是我不知道哪裡錯了
Create a news item - News
News
Create a news item
Title
Text
wsdfsfdsa
我的css檔案夾和header.php頁面都是在news檔案夾下面的,不知道到底哪裡錯了,請大牛指點啊,本人是剛剛接觸php的
------解決方案--------------------
http://127.0.0.1/myPhpStudy/index.php/css/yangshi.css" />
這是有效地路徑嗎?
難道 index.php 是目錄?
------解決方案--------------------
base_url("css/yangshi.css");?>" />試試?
------解決方案--------------------
href=""這個在頁面上列印出來的串連發出來看看
------解決方案--------------------
dirname($this->config->item('base_url'));?>css/yangshi.css" />
------解決方案--------------------
------解決方案--------------------
貼出的的目錄結構
並指出你的檔案的位置
------解決方案--------------------
在網站直接輸入http://127.0.0.1/myPhpStudy/index.php/css/yangshi.css能訪問嗎?是不是css這個目錄限制訪問的?
------解決方案--------------------
執行的檔案為 myPhpStudy/index.php
樣式表在 myPhpStudy/application/css 中
所以樣式表的路徑應為
dirname($this->config->item('base_url')) . '/application/css/'