Laravel 5 issues with linking css assets

ε祈祈猫儿з 提交于 2019-12-04 04:23:10
Sojan V Jose

found the answer here on this thread and here . on the second thread Taylor Otwell gives the answer himself . In laravel 5 , the laravel 4 default syntax {{ code }} , will escape the data output . if you want unescaped html data, you have to use the new syntax

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

if you want to revert to previous syntax you can use

Blade::setRawTags('{{', '}}');
  1. Check if the assets are there, and are being linked properly.
  2. check permission and set chmod to 777 (Unix).
  3. If that doesn't work, use <link rel="stylesheet" type="text/css" href="{{asset('relative/to/public/folder.css')}}" > manually.
<link href="{{ asset("assets/css/style.css") }}" rel="stylesheet">

Change your code to the below

{!! Html::style( asset('css/bootstrap.min.css')) !!}
{!! Html::style( asset('css/style.css')) !!}

If you want to use plain HTML then you can also use it like this-

    <link rel="stylesheet" href="/css/style.css">
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!