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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 16:54:36  来源:igfitidea点击:

Laravel background color

phphtmlcsslaravel

提问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 浅蓝色。(见截图)有人可以帮助我吗?非常感谢

enter image description here

在此处输入图片说明

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 cssstyle 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 bodyin it.

您还应该记住,总页面布局是layouts/app.blade.php,您可以body在其中找到父容器。