I recently wanted to do this, but some of the solutions found were more complex than necessary. What I did was pretty much exactly what uʍopǝpısdn has already stated in the comments on your question, i.e. Wrap .container in div .
I created several color styles for each of the sections that I need:
.bg-black { background-color:
And used these styles as the classes of each packaging div :
<div class="bg-black"> <div class="container"> //content here </div> </div> <div class="bg-red"> <div class="container"> //other content here </div> </div> //...and so on
This solution obviously requires you to restructure your HTML to use one .container for each section instead of one .container per body , which, it seemed to me, works quite well.
source share