Laravel 背景色
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/47088615/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Laravel background color
提问by blastme
I am trying to give my view page a background color but it keeps on only giving me 3/4 of the page light blue when I want everything. (see screenshot) Can anyone help me? Thanks a lot
我试图给我的视图页面一个背景颜色,但当我想要所有东西时,它只给我页面的 3/4 浅蓝色。(见截图)有人可以帮助我吗?非常感谢
Here is the css code that I am using: background.css
这是我正在使用的 css 代码:background.css
.container{
background-color: lightblue;
}
view.blade.php
视图.blade.php
@extends('layouts.app')
@section('content')
<link href="{{ asset('css/background.css') }}" rel="stylesheet">
<div class="container">
<div class="row">
<div class="col-md-8 col-md-offset-2">
<div class="panel panel-default">
<div class="panel-heading">Dashboard</div>
<div class="panel-body">
@if (session('status'))
<div class="alert alert-success">
{{ session('status') }}
</div>
@endif
You are logged in!
</div>
</div>
</div>
</div>
<h1>Overview</h1>
<table class="table table-bordered">
<tr>
<th><strong><big>Name: </big></strong></th>
<th><strong><big>Action: </big></strong></th>
</tr>
<td>
<tr>
@foreach($data as $value)
<tr>
<th><a href="{{route('user.show',['id'=>$value->pi_id])}}">{{$value->Name}}</a></th>
<th><form action="{{ url('/home/'.$value->pi_id.'/delete') }}" method="get">
{{ csrf_field() }}
<button type="submit">Delete</button>
</form></th>
</tr>
@endforeach
</div>
@endsection
采纳答案by shukshin.ivan
Your page is not blue since you assign the color to a container on page. Change your css
style to
您的页面不是蓝色,因为您将颜色分配给页面上的容器。改变你的css
风格
body{
background-color: lightblue;
}
You should also keep in mind, that total page layout is layouts/app.blade.php
, you can find parent container body
in it.
您还应该记住,总页面布局是layouts/app.blade.php
,您可以body
在其中找到父容器。