6/11/24, 6:34 PM php - CSS not loading in Laravel 5.
2 - Stack Overflow
2024 Developer survey is here and we would like to hear from you! Take the 2024 Developer Survey
CSS not loading in Laravel 5.2
Asked 7 years, 11 months ago Modified 7 years, 11 months ago Viewed 496 times Part of PHP Collective
Situation:
I'm creating a web application using Laravel, but for the moment CSS that i created aren't
0
loading.
Folder Structure
Laravel Version
[Link] 1/3
6/11/24, 6:34 PM php - CSS not loading in Laravel 5.2 - Stack Overflow
Laravel Framework version 5.2.36
[Link] code
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>@yield('title')</title>
<link rel ="stylesheet" href= "{{ URL::secure('src/css/[Link]') }}">
@yield('styles')
</head>
<body>
@include('[Link]')
<div class="main">
@yield('content')
</div>
</body>
</html>
php html css laravel laravel-5
Share Improve this question Follow asked Jun 23, 2016 at 9:09
AVI
5,645 5 29 40
Why is there a src folder in your public folder? – tkausl Jun 23, 2016 at 9:11
Is it loading with asset like so <link rel ="stylesheet" href= "{{
URL::asset('src/css/[Link]') }}"> ? – linuxartisan Jun 23, 2016 at 9:11
2 Answers Sorted by: Highest score (default)
Write like this:
5 <link rel ="stylesheet" href= "{{ asset('src/css/[Link]') }}">
Share Improve this answer Follow answered Jun 23, 2016 at 9:12
Arnab Rahman
1,013 1 9 15
[Link] 2/3
6/11/24, 6:34 PM php - CSS not loading in Laravel 5.2 - Stack Overflow
Another alternative:-
3 <link rel="stylesheet" href="{{ url('/') }}./src/css/[Link]" type="text/css"/>
Share Improve this answer Follow answered Jun 23, 2016 at 9:16
Ravi Hirani
6,479 1 29 42
[Link] 3/3