Question about section and container divs

Hello, I have a question. i have seen some people put container div inside of a section, and add css like this:

section{
padding-block: 5rem 10rem;
}

.container{
max-width: 1200px;
margin-inline: auto;
padding-inline: 2rem;
}


I know that we can add background to section this way and let it take width of full window, but if theres no background is it possible to put it all in a section tag ? And does it matter if theres div container or no? Thank you


section{
padding-block: 5rem 10rem;
max-width: 1200px;
margin-inline: auto;
padding-inline: 2rem;
}
Was this page helpful?