Laravel background color

14,075

Your page is not blue since you assign the color to a container on page. Change your css style to

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.

Share:
14,075

Related videos on Youtube

blastme
Author by

blastme

Updated on June 04, 2022

Comments

  • blastme
    blastme almost 2 years

    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

    enter image description here

    Here is the css code that I am using: background.css

    .container{
        background-color: lightblue;
    }
    

    view.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
    
    • Minal Chauhan
      Minal Chauhan over 6 years
      where is a screenshot?
    • blastme
      blastme over 6 years
      Just added, forgot to put in @Minai Chauhan
    • Saurav Rastogi
      Saurav Rastogi over 6 years
      Please put the full HTML code (parsed one).
    • blastme
      blastme over 6 years
      @SauravRastogi but this is my full code..
    • Saurav Rastogi
      Saurav Rastogi over 6 years
      @blastme Where is the header & footer?
    • blastme
      blastme over 6 years
      @SauravRastogi that is in another page, is that needed? If yes I will post it
    • psuresh
      psuresh over 6 years
      @blastme Right click on the page and inspect elements, go through each div and see associated CSS.
    • Saurav Rastogi
      Saurav Rastogi over 6 years
      @blastme Do you need the full height of the page to blue or the width?
    • blastme
      blastme over 6 years
      @SauravRastogi I want the whole page to be blue but for some reason it only stay until half way
    • shukshin.ivan
      shukshin.ivan over 6 years
      So give the color to body, not to the container selector only.
    • blastme
      blastme over 6 years
      Oh my god it worked thanks a lot, maybe you can put your answer below so that I can upvote you @shukshin.ivan
    • Harden Rahul
      Harden Rahul over 6 years
      Instead of giving a background color to .container try to give this color to his parent element