2014-09-20 72 views
0
laravel 4.2: my demo project in ytform when i try to add css file (style.css) from public folder having another folder, css folder. try to get any class its not working . 

in View: i have an other folder, name layouts and i am accessing here css file but not working? 

其中master.blade.php添加CSS文件

<head> 
    @section('head') 
    <meta charset="UTF-8"> 
    <!-- Latest compiled and minified CSS --> 
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"> 
<link rel="stylesheet" type="text/css" href="/css/style.css"> 
    @show 

</head> 

我嘗試用給定的兩種方式卻徒勞無功,css文件中沒有任何視圖文件夾的文件支持如何添加CSS文件

<link rel="stylesheet" type="text/css" href="/css/style.css"> 

    {{HTML::style('css/style.css')}} 

any solution or mistake ? 
+0

發表您的文件結構這裏 – Deryck 2014-09-20 09:50:21

+0

---> public-folder ---> css-folder = style.css – 2014-09-22 04:45:21

+0

---> publicfolder ---> jsfolder = app.js文件 – 2014-09-22 04:46:28

回答

0
<link rel="stylesheet" type="text/css" href="{{ asset('css/style.css') }}"> 

你可以試試這個

{{ HTML::style(asset('css/site.css'), array('rel' => 'stylesheet', 'type' => 'text/css')) }} 

和css文件需要在公用文件夾這個工作

+0

我嘗試兩種方式,但不工作? – 2014-09-20 10:04:36

+0

你的css文件在哪裏?在哪個文件夾中? – Mirage 2014-09-20 10:45:07

+0

在公共文件夾中-----> css文件夾,style.css將進入css文件夾 – 2014-09-21 05:43:52

0

只是包括一些線Blade template

{{ HTML::style('css/main.css') }} 

here作爲參考

+0

是的,我添加了相同的,但沒有工作的CSS文件:{{HTML :: style('css/style.css')}} – 2014-09-20 10:05:33

+0

Avinash Babu你有另一種解決方案嗎? – 2014-09-21 05:54:51