could anyone share with me how to place objects in one line and distribute evenly on the screen using CSS? I’m a newcomer to web world, just trying to create own project.
I have the following html code:
section class="contact section" id="contact">
<h2 class="section__title">Contact Me</h2>
<span class="section__subtitle">Get in touch</span>
<div class="contact__container container grid">
<div>
<div class="contact__information">
<i class="fas fa-phone contact__icon"></i>
<div>
<h3 class="contact__title">Call me</h3>
<span class="contact__subtitle">+49 423 9239 23</span>
</div>
</div>
<div class="contact__information">
<i class="fa-solid fa-envelope contact__icon"></i>
<div>
<h3 class="contact__title">Email</h3>
<span class="contact__subtitle">[email protected]</span>
</div>
</div>
<div class="contact__information">
<i class="fa-solid fa-location-dot contact__icon"></i>
<div>
<h3 class="contact__title">Location</h3>
<span class="contact__subtitle">Hamburg, Germany</span>
</div>
</div>
</div>
</div>
</section>
</main>
.contact__information{
display: flex;
flex-direction: row;
justify-content: center;
}
My result was provided in attachments.
I’m using that CSS block, but it place by a column in the center. I would like to spread contact details in a human-redable format in one line (something like this, bit it changes positions when you use other screen size.
2
Answers
And the
div
betweencontact__container
andcontact__information
is not necessary.Add css on div child of div
contact__information