css – How to center multiple divs without overlapping?

I want to enter a title, a line and a subtitle in the center of an image (horizontally and vertically), in this order from top to bottom, with the line between the two texts, but they keep overlapping. I’ve tried some answers from other questions, such as changing from div to span and setting display:block… Read More css – How to center multiple divs without overlapping?

How to use flex to get this special distribution?

My goal is to place 5 boxes on the corner and in the center. like this These are my codes: .container { width: 240px; height: 200px; border: 1px solid gray; display: flex; flex-direction: row; flex-wrap: wrap; justify-content: space-between; align-content: space-between; } .container > div { width: 80px; height: 50px; border: 1px solid red; display: flex;… Read More How to use flex to get this special distribution?

How to center a h1 tag inside a section tag

I need to center-left a < h1 > element inside a < section >, however, I’m struggling finding the correct method. I’ve tried using justify-content and text-align, but it doesn’t move it. I can move with it padding, but, I’m not sure this is good responsively. HTML: <section class="hero"> <h1 class="hero__title">My Website</h1> <img class="hero__image" src="./assets/images/hero-bio.jpg"… Read More How to center a h1 tag inside a section tag