How can I define elements positions in HTML/CSS

Viewed 37

I'm trying to learn HTML and CSS and I've came across the following question.

I need to insert a vertical gap between the elements of the site::

Image01

To be like that:

Image01

But I have no idea to get it done without using a lot of <br>.

Can someone help me to get this done?

Thanks so much!

3 Answers

gap style property is for display - flex, but you can use margin-bottom for this, here is example.

<div>
    <div class="header">
        <h2>Header</h2>
    </div>
    <h1>Header</h1>
<div>

.header {
    margin-bottom: 50px;
}

you can also insert in a line break with the br tag <br>

Related