0
我正在嘗試更改gridview
,tableview
,& detailview
的樣式。我發現一些說我應該在config/main.php
文件改成這樣:更改YII應用程序中的CSS文件不起作用
...
// application components
'components'=>array(
'user'=>array(
// enable cookie-based authentication
'allowAutoLogin'=>true,
),
'bootstrap'=>array(
'class'=>'bootstrap.components.Bootstrap',
),
'widgetFactory'=>array(
'widgets'=>array(
'CGridView'=>array(
'cssFile' => Yii::app()->request->baseUrl.'/css/table_and_grid.css',
),
),
),
...
我已刪除由應用程序產生的資產文件夾,但沒有幫助。當我加載視圖時,我可以看到CSS表正在加載到頁面的標題中,但沒有任何樣式正在工作。爲什麼?我該如何解決?
什麼位置做您的自定義CSS文件加載?你可以使用Web檢查器來檢查瀏覽器對你的CSS規則的解釋嗎? –
@ragingprodigy這是第一個加載。瀏覽器不解釋任何規則,這是問題所在。 – BlackHatSamurai
我不認爲你需要改變main.config改變風格。如果您需要更改樣式,則可以覆蓋基類中的函數和屬性。 –