首页 > 解决方案 > 样式文件不包含在 php laravel 中

问题描述

我连接引导程序,但 laravel 找不到样式 app.blade.php:

<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <meta name="csrf-token" content="={{csrf_token()}}">
    <title>@yield('title-block')</title>
    <link rel="stylesheet"  href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css">
    <link rel="stylesheet" type="text/css" href="public/css/bootstrap.css">
    <link rel="stylesheet" type="text/css" href="public/css/style.css">


</head>
<body>
@yield('content')

</body>
</html>

<?php

注册.blade.php:

@extends('layouts.app')
@section('title-block')
    Регистрация
@endsection

@section('content')

    <div class="container">
        <h1 align="center">
{{--            <a href="index.html"><img src="img/logo.jpg" alt="logo" class="home"></a>--}}
            Register
        </h1>
    </div>
    <hr>

    <form name="register" method="POST" action="{{route('user.registration')}}">
        @csrf

            <input class="text-input" type="text" placeholder="Enter your surname" name="surname" required>
            <input class="text-input" type="text" placeholder="Enter your name" name="name" required><br>

            <input class="text-input" type="text" placeholder="Enter your number" name="number" required><br>

        <input class="text-input" type="text" placeholder="Enter your father`s name" name="fathers_name" required>
        <input class="text-input" type="text" placeholder="Enter parent number" name="parents_number" required><br>

            <input class="text-input-full-width" id="password" name="password" type="password" required placeholder="Enter password"><br>



            <button class="btn btn-lg btn-primary" type="submit" name="sendMe" value="1">Войти</button>



    </form>
@endsection

我是初学者,不明白为什么 laravel 看不到styles.css。我试过这个

但它不起作用。我希望你能帮我 在这里输入图片描述

标签: phphtmlcsslaravel

解决方案


<link href="{{ asset('css/style.css') }}" rel="stylesheet">

推荐阅读