简体   繁体   中英

Can't reach css files laravel-9

I am building a website. in index page everything works. But I tried to add page. At service page, I can reach the content but it is unstyled.

My index file starts like this

@extends('layouts.frontbase')

@section('title', 'Pasa Law')

@section('content')

    @include("home.slider")

My service file is same

@extends('layouts.frontbase')

@section('title', $data->title)


@section('content')

    <p>{{$data->detail}}</p>

@endsection

When I open site css and javascript files are okey in index index page

But when I open service site it has problems with css service page

Frontbase.blade.php

<html>
    <head>
        <title>@yield('title')</title>
        @yield('head')
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta http-equiv="X-UA-Compatible" content="ie=edge">
        <meta name="copyright" content="Kaan Pasa, https://github.com/kaanpasa">

        <title>@yield("title")</title>

        <link rel="stylesheet" href="assets/css/maicons.css">
        <link rel="stylesheet" href="assets/vendor/animate/animate.css">
        <link rel="stylesheet" href="assets/css/bootstrap.css">
        <link rel="stylesheet" href="{{asset('assets/vendor/owl-carousel/css/owl.carousel.css')}}">
        <link rel="stylesheet" href="assets/css/theme.css">
        <!-----Slider CSS--->
        <link rel="stylesheet" href="/assets/css/owl.theme.default.min.css">
        <link rel="stylesheet" href="assets/css/ionicons.min.css">
        <link rel="stylesheet" href="assets/css/style.css">
    </head>

    <body class="bg-light">
        @include("home.header")
        <div class="container">
            @yield('content')
        </div>
        @include("home.footer")
        @yield('foot')
    </body>
</html>

If your link is

link rel="stylesheet" href="/css/styles.css"

try

link rel="stylesheet" href="{{ asset('css/styles.css') }}"

and put your css files in the public folder eg

public|->css|->styles.css
 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM