2014-09-20 71 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