Why put everything inside a container in this case?

I’m learning to build this website in CSS from scratch.

I don’t understand why we’re adding that text inside container?

This is container CSS:


.container{

max-width:1180px;

margin-inline:auto; /*container centre*/

padding-inline:var(--padding-inline-section)

}

Hi,

Please don’t post pictures of code - it is easier to help if you cut and paste it - then we can cut and paste to quote. Here is how to put code in a message:

When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (').

I don’t understand the question. They put the text so it will show up on the screen. They put it in that place because that’s where they want it to be in the DOM and they want it to inherit the styling there.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.