1

Sorry if this is worded poorly, so if I had something like this

<body>
<main role="main" class="container">
  <div class="row">
  <div class="col-sm-4">1</div>
  <div class="col-sm-4">2</div>
  <div class="col-sm-4">3</div>
  <div class="col-sm-6">Some Text</div>
  <div class="col-sm-6">Some Text</div>
  <div class="col-sm-12">6</div>
</div>
</main>
</body>

I'd want to change the color of #test to something else but if I do something like

body {
   background-color: grey;
}
#test {
   background-color: yellow;
   background-size: cover;
}

It will only color the background of the grid and not the entire page. The sides of the page will remain white and I don't know how to remedy this

I'd like the yellow to reach the edge of the page

Example of the yellow not reaching

Sonohi
  • 17
  • 5

2 Answers2

0

For the backgorung of the the page add css as

body {
  background-color: grey;
}

And for the background of the grid to be different take the grid id as #test and aplly the css as

#test {
  background-color: yellow;
  border: 1px solid red;
  height: 20px;
}

And channge your main class to

<main class = "container-fluid">

Have a look at the following image enter image description here

Note: Body changes the color of the whole body of the page whereas #test changes the color of the test id specified to respective class.

Kunal Raut
  • 2,495
  • 2
  • 9
  • 25
0

Just add

    #test
     {
     Background-color:grey;
     background-size:cover} 
Himanshu
  • 3,830
  • 2
  • 10
  • 29