【发布时间】:2021-06-01 09:48:10
【问题描述】:
我需要帮助将颜色设置为 html div。我使用 Laravel 8,当然我安装了简单的身份验证模块 Breeze 和 tailwind css 框架。但现在我需要更改身份验证卡的颜色。 我所有的视图都使用刀片模板引擎,这是我的访客刀片源:
<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="csrf-token" content="{{ csrf_token() }}">
<title>{{ config('app.name', 'Laravel') }}</title>
<!-- Fonts -->
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700&display=swap">
<!-- Styles -->
<link rel="stylesheet" href="{{ asset('css/app.css') }}">
<!-- Scripts -->
<script src="{{ asset('js/app.js') }}" defer></script>
</head>
<body>
<div class="font-sans text-gray-900 antialiased">
{{ $slot }}
</div>
</body>
</html>
还有我的登录视图源:
<x-guest-layout>
<x-auth-card>
<x-slot name="logo">
<a href="/">
<img class="header-logo-image" width="100" height="100" src="{{ asset('images/welcome_images/logo.svg') }}" alt="Logo">
</a>
</x-slot>
<!-- Session Status -->
<x-auth-session-status class="mb-4" :status="session('status')" />
<!-- Validation Errors -->
<x-auth-validation-errors class="mb-4" :errors="$errors" />
<form method="POST" action="{{ route('login') }}">
<!-- This is form for posting my request -->
</form>
</x-auth-card>
</x-guest-layout>
如您所见,我在访客刀片中使用 $slot 变量使用“x-”标签注入登录页面内容。但是我怎样才能改变背景颜色呢?我尝试在标签中使用 'class="lol" style="background-color: white;"' 进行设置,但没有成功。
【问题讨论】:
-
尝试内联css
-
我已经试过了。我也在我的问题中描述了它。但它没有用。
标签: html css laravel-blade