How to link bootstrap and external css with laravel 5.3?

I am trying to add bootstrap and an external css file to my laravel project using two methods

<link rel="stylesheet" href="../../assets/css/scrolling-nav.css">

                                 and
<link rel="stylesheet" href="{{ URL::asset('css/scrolling-nav.css') }}" />

in both directions, but the console displays an error. my directory structure, as shown in the figure, will help me get out of this problem.

+4
source share
2 answers

Always place js / css files in a public folder. In your case, try to do this. Create an entire copy of the data folder in the shared folder.

For stylesheet.

 <link rel="stylesheet" type="text/css" href="{{url('assets/css/bootstrap.min.css')}}"/> 

And for the JS file ..

<script src="{{url('assets/js/components/bootstrap.js')}}"></script>
+2
source

resources/assets Elixir , public.

Elixir Gulp, public :

<link rel="stylesheet" href="{{ asset('css/scrolling-nav.css' }}">
0

Source: https://habr.com/ru/post/1664890/


All Articles