How to put an space between div's?

<div class="main">
    <div class="left">

        <img class="photo" src="photo.jpg" alt="This is my photo">
        <div class="name">
            <h1>Buwaneka Godage</h1>
        </div>


        <div class="contact">
            <h1>Contact</h1>
            <div class="address">
                <h4>Kandewaththa Road,<br>Kuru/Bopitya</br>
                </h4>
            </div>

            <div class="aboutme">
                <h4 class="aboutme">About me</h4>
                <p>Lorem ipsum dolor sit, amet consectetur adipisicing elit. Ad, iure! Repudiandae eos odit debitis labore. Illum distinctio hic atque assumenda dolorem sit itaque cupiditate voluptatem? Perferendis impedit cum, sunt similique asperiores
                    blanditiis nostrum ipsa placeat sequi tempora! Illum nostrum ipsa id tempore enim ex suscipit quae ratione, atque unde aspernatur eligendi distinctio pariatur dolorum, adipisci dolor asperiores reiciendis facere mollitia repellat corrupti.
                    Laudantium deserunt provident quas voluptas. Incidunt, blanditiis! Aliquam modi facilis id, beatae repudiandae quas impedit blanditiis repellendus! Ipsa minima temporibus magnam? Sed suscipit quia dolorem cupiditate repudiandae est
                    porro odit temporibus perspiciatis quae totam sapiente quidem, vel nisi.</p>
            </div>

        </div>

.main {

display: grid;

grid-template-columns: 20% 80%;

}

.left {

background-color: aqua;

height: fit-content;

text-align: center;

justify-content: space-between;

}

.photo {

width: 200px;

height: 200px;

border-radius: 100%;

position: relative;

top: 5px;

border-color: white;

border-width: 10px;

border-style: solid;

}

.contact {

position: relative;

top: 60px;

padding: 30px;

}

You have justify-content: space-between on .left but it isn’t going to do anything unless .left is a flexbox or grid container (display flex or grid).

You can still use margin to create space between elements, or again if set it to flex/grid you also have the gap property you can use.

1 Like