主页刀片中的登录表单仍然固定在左侧,我需要将其放在页面中央,你能帮助我吗?整个完整视图位于存储库中
我尝试使用网格和样式但失败了,这是 phpvms7 的视图
谢谢回复的人
这是代码和视图存储库:
@extends('app')
@section('title', __('home.welcome.title'))
@section('content')
<div class="form">
<h1>@lang('common.login')</h1>
@if(Auth::check())
{{-- Itera sugli utenti solo se l'utente è autenticato --}}
@foreach($users as $user)
<!-- Codice per visualizzare gli utenti autenticati -->
@endforeach
@else
<div class="card">
<div class="card-body">
<form method="POST" action="{{ route('login') }}">
<div class="form-group" style="max-width: 100%;">>
<label for="email">@lang('common.email')</label>
<input type="email" name="email" id="email" class="form-control" required>
</div>
<div class="form-group">
<label for="password">@lang('Password')</label>
<input type="password" name="password" id="password" class="form-control" required>
</div>
<button type="submit" class="btn btn-primary btn-block">@lang('common.login')</button>
</form>
</div>
</div>
@endif
</div>
</div>
@endsection
尝试使用 Bootstrap 的实用程序类
因此将其添加到主刀片布局的头部
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" rel="stylesheet">
你的代码应该看起来像这样:
@extends('app')
@section('title', __('home.welcome.title'))
@section('content')
<div class="form d-flex justify-content-center align-items-center" style="height: 100vh;">
<div class="card">
<div class="card-body">
<h1 class="text-center">@lang('common.login')</h1>
@if(Auth::check())
{{-- Itera sugli utenti solo se l'utente è autenticato --}}
@foreach($users as $user)
<!-- Codice per visualizzare gli utenti autenticati -->
@endforeach
@else
<form method="POST" action="{{ route('login') }}">
<div class="form-group">
<label for="email">@lang('common.email')</label>
<input type="email" name="email" id="email" class="form-control" required>
</div>
<div class="form-group">
<label for="password">@lang('Password')</label>
<input type="password" name="password" id="password" class="form-control" required>
</div>
<button type="submit" class="btn btn-primary btn-block">@lang('common.login')</button>
</form>
@endif
</div>
</div>
</div>
@endsection