CSS CSS Layout Basics Getting Started with CSS Layout Centering Page Content and Creating a Full-width Header

Tomáš Komprs
Tomáš Komprs
12,204 Points

Why from 2 same container is affected just One?

We created 2x same div/classes <div class="container"> But why when he ,,target,, class .container in css is affected just the second one from ,,main,, content? It should affect the both no?

Frans de Haan
Frans de Haan
6,303 Points

Hello Tomáš,

It's difficult to answer on a question without the seeing the code.

If I hear your question, I think it's because you forget somewhere to close another div or open a div and doesn't close it.

Please share your code for a better answer.

1 Answer

Frans de Haan
Frans de Haan
6,303 Points

Hello,

It's still diffecult to see the exact problem with html only. Can you share your workspace here.

By going to workspaces, then click the workspace you are working in and inside it on make a snapshot the link from the snapshot you can share with us.

The first container is inside the header so only the content inside the container is narowed down. The background-color is specified to the header and streches still to the edges of the screen.

Tomáš Komprs
Tomáš Komprs
12,204 Points

I think I right now figure out what was ,,the problem,,. He put <div> inside header insted out of header. And because of that, this have a influence only on the content inside of course.. :-D Sorry I bothering you with a silly thing like this. But, Thank you a much for helping me!! Have a nice day :)