php - 样式文件不包含在 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。我试过这个
但它不起作用。我希望你能帮我 在这里输入图片描述
解决方案
<link href="{{ asset('css/style.css') }}" rel="stylesheet">
推荐阅读
- laravel - 如何正确更新只有一个标识 ID 的数组
- c++ - 我想根据小数位在列中对齐我的结果
- python - 如何使用类支持python中的`in`操作
- jquery - jQuery Deferred - 如何在 .done() 执行之前等待或延迟 .animate 函数完成?
- python - 对最后一个元素使用一种形状,对图表中的所有其他元素使用另一种形状
- javascript - IE11 中的 postMessage 处理
- arrays - 如何删除此 for 循环并改用 array.some 函数?
- python - 网页抓取时如何使用 FindAll
- xamarin - Xamarin 窗体 ImageRenderer 无法访问
- r - 在 R 函数内部和外部拆分 data.frame