CSS - how to make background go outside container?

Hello,
Im trying to code design for portfolio, and im wondering what is the right way to do.

How to make background go outside of a container the right way? since theme has container in which is everything else header main etc… with width ant its centered, and every other section has different background, but they dont go outside container or if i do i do it in sketchy ways i dont understand.

One way on which i used to do is for example create and within put div.container and put bg on header, but since im doing it with footer, sections it doesnt seem nice frome code perspective a lot of nesting and it realy doesnt seem correct.
Could somebody give me a correct idea of doing it?