What's causing the first title to be placed in the middle?

I want the section 1 title where the section 2 title is, when I added the 3 div blocks it automatically moved it down next to the divs.

It’s the align-items: center on that <section> that is causing the content in that <section> to center vertically. I’m not sure what you are trying to do here but you might not want to put display: flex on <section class="sec1">?

But getting rid of align-items: center makes the divs up top next to the title. I want the section on top and the divs in the middle.

I was trying to experiment and see if a container could be both a child and a parent element simultaneously.

I’m sure this can be done, just not with the HTML you currently have. You might have to add more helper <div>s, perhaps around the three <div>s in that <section>. Also you are most likely going to have to put the text “Section 1” inside some type of element. Add the extra HTML and keep playing with it until you get what you want.

FYI, comments in CSS are only /* ... */. The // works in JS but is not legal in CSS.

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