CSS Grid – How To Remove Extra Space On Items

so I am not good at Grid so I am stuck here. As you can see in the images there is an extra space in my css grid that I don’t want. How can I do it like the design shown.

HTML

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code> <section class="timeline">
<div class="timeline-info">
<h2>The Timeline</h2>
</div>
<div class="timeline-container">
<div class="one timeline-item">
<img src="/images/timeline/pioneer.jpg" width="240">
<div class="timeline-item-content">
<h3>Pioneer 0</h3>
<time>17 August 1958</time>
<p>Pioneer 0 was a failed United States space probe that was designed to go into orbit around the Moon, carrying a television camera, a micrometeorite detector and a magnetometer, as part of the first International Geophysical.</p>
</div>
</div>
<div class="two timeline-item">
<img src="/images/timeline/luna-24.jpg" width="240" alt="Luna 24" class="timeline-item-image">
<div class="timeline-item-content">
<h3>Luna 24</h3>
<time>9 August 1976</time>
<p>Luna 24 was an unmanned space mission of the Soviet Union's Luna programme. The last of the Luna series of spacecraft, the mission of the Luna 24 probe was the third Soviet mission to retrieve lunar soil samples from the Earth's moon (the first two sample return missions were Luna 16 and Luna 20). The spacecraft orbital dry mass was 4,800 kg (10,600 lb).</p>
</div>
</div>
...
</section>
</code>
<code> <section class="timeline"> <div class="timeline-info"> <h2>The Timeline</h2> </div> <div class="timeline-container"> <div class="one timeline-item"> <img src="/images/timeline/pioneer.jpg" width="240"> <div class="timeline-item-content"> <h3>Pioneer 0</h3> <time>17 August 1958</time> <p>Pioneer 0 was a failed United States space probe that was designed to go into orbit around the Moon, carrying a television camera, a micrometeorite detector and a magnetometer, as part of the first International Geophysical.</p> </div> </div> <div class="two timeline-item"> <img src="/images/timeline/luna-24.jpg" width="240" alt="Luna 24" class="timeline-item-image"> <div class="timeline-item-content"> <h3>Luna 24</h3> <time>9 August 1976</time> <p>Luna 24 was an unmanned space mission of the Soviet Union's Luna programme. The last of the Luna series of spacecraft, the mission of the Luna 24 probe was the third Soviet mission to retrieve lunar soil samples from the Earth's moon (the first two sample return missions were Luna 16 and Luna 20). The spacecraft orbital dry mass was 4,800 kg (10,600 lb).</p> </div> </div> ... </section> </code>
    <section class="timeline">
        <div class="timeline-info">
            <h2>The Timeline</h2>
        </div>
        <div class="timeline-container">
            <div class="one timeline-item">
                <img src="/images/timeline/pioneer.jpg" width="240">
                <div class="timeline-item-content">
                    <h3>Pioneer 0</h3>
                    <time>17 August 1958</time>
                    <p>Pioneer 0 was a failed United States space probe that was designed to go into orbit around the Moon, carrying a television camera, a micrometeorite detector and a magnetometer, as part of the first International Geophysical.</p>
                </div>
            </div>
            <div class="two timeline-item">
                <img src="/images/timeline/luna-24.jpg" width="240" alt="Luna 24" class="timeline-item-image">
                <div class="timeline-item-content">
                    <h3>Luna 24</h3>
                    <time>9 August 1976</time>
                    <p>Luna 24 was an unmanned space mission of the Soviet Union's Luna programme. The last of the Luna series of spacecraft, the mission of the Luna 24 probe was the third Soviet mission to retrieve lunar soil samples from the Earth's moon (the first two sample return missions were Luna 16 and Luna 20). The spacecraft orbital dry mass was 4,800 kg (10,600 lb).</p>
                </div>
            </div>
           ...
    </section>

CSS

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>.timeline-container {
max-width: 1100px;
display: grid;
grid-template-columns: 1fr 1fr;
gap: 40px;
grid-auto-flow: dense;
grid-template-areas:
"one two"
"three four"
"five six";
}
.timeline-item{
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
border-top: 6px solid #333333;
padding: 20px; /* Adjust padding as needed */
background-color: #222222;
box-sizing: border-box; /* Ensure padding and border are included in the width and height */
}
.timeline-item-content{
color: white;
margin-top: 20px;
}
.timeline-item-content h3{
font-size: 24pt;
font-weight: 600;
margin-bottom: 10px;
}
.timeline-item-content time{
color: #ccc;
}
.timeline-item-content p{
margin-top: 10px;
line-height: 1.5;
}
</code>
<code>.timeline-container { max-width: 1100px; display: grid; grid-template-columns: 1fr 1fr; gap: 40px; grid-auto-flow: dense; grid-template-areas: "one two" "three four" "five six"; } .timeline-item{ display: flex; justify-content: center; align-items: center; flex-direction: column; border-top: 6px solid #333333; padding: 20px; /* Adjust padding as needed */ background-color: #222222; box-sizing: border-box; /* Ensure padding and border are included in the width and height */ } .timeline-item-content{ color: white; margin-top: 20px; } .timeline-item-content h3{ font-size: 24pt; font-weight: 600; margin-bottom: 10px; } .timeline-item-content time{ color: #ccc; } .timeline-item-content p{ margin-top: 10px; line-height: 1.5; } </code>
.timeline-container {
    max-width: 1100px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    grid-auto-flow: dense;
    grid-template-areas:
        "one two"
        "three four"
        "five six";
}
.timeline-item{
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    border-top: 6px solid #333333;
    padding: 20px; /* Adjust padding as needed */
    background-color: #222222;
    box-sizing: border-box; /* Ensure padding and border are included in the width and height */
}
.timeline-item-content{
    color: white;
    margin-top: 20px;
}
.timeline-item-content h3{
    font-size: 24pt;
    font-weight: 600;
    margin-bottom: 10px;
}
.timeline-item-content time{
    color: #ccc;
}
.timeline-item-content p{
    margin-top: 10px;
    line-height: 1.5;
}

I was trying to do the design I added but it ended up having extra space.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật