Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

324
Views
How to align elements showed on image? [HTML&CSS]

I am here to ask you about one CSS question. How can I align these elements like they're shown on the picture? I will provide also HTML code.

https://i.imgur.com/ByO5bIC.png

<header>
<div class="header-main">
  <a href="about-us.html">ABOUT US</a>
  <a id="toplica" href="index.html">TOPLICA</a>
  <a href="contact.html">CONTACT</a>
</div>
<div class="social-media">
  <span class="iconify" data-icon="ant-design:instagram-filled" style="color: #ba4a1d;"></span>
  <span class="iconify" data-icon="ant-design:facebook-filled" style="color: #ba4a1d;"></span>
  <span class="iconify" data-icon="fluent:location-28-filled" style="color: #ba4a1d;"></span>
</div>
</header>

Thank you.

about 4 years ago · Juan Pablo Isaza
3 answers
Answer question

0

You can use the flex property in each parent container and give them properties like:

.PARENT_CONTAINER_NAME{
    display: flex;
    justify-content: center;  // for horizontal alignment
    align-items: center;      // for vertical alignment
}

Make sure to give height and width to the parent container and experiment with a few other values of justify-content to get your desired output.

about 4 years ago · Juan Pablo Isaza Report

0

Try this:

<header class="header-flex">
<div>
  /* keep it empty */
</div>
<div class="header-main">
  <a href="about-us.html">ABOUT US</a>
  <a id="toplica" href="index.html">TOPLICA</a>
  <a href="contact.html">CONTACT</a>
</div>
<div class="social-media">
  <span class="iconify" data-icon="ant-design:instagram-filled" style="color: #ba4a1d;"></span>
  <span class="iconify" data-icon="ant-design:facebook-filled" style="color: #ba4a1d;"></span>
  <span class="iconify" data-icon="fluent:location-28-filled" style="color: #ba4a1d;"></span>
</div>
</header>

and then in your header-flex:

.header-flex {
  display:flex;
  width: 100vw;
  justify-content: center;
  align-items: center;
}

and in your header-main:

.header-main {
  display:inline-block;
  margin: 0 15vw;
  /* replace 15vw with whatever margin you need to push the social media icons to the edge */
}
about 4 years ago · Juan Pablo Isaza Report

0

you can just put .socail-media within the .header-main like the following code

   <style>

        .header-main{
            display: flex;
            justify-content: center;
            align-items: center
        }
a{
margin: 0 5px;}

        .social-media{
            display: flex;
            justify-content: end;
        }
    </style>


    <header>
        <div class="header-main">
          <a href="about-us.html">ABOUT US</a>
          <a id="toplica" href="index.html">TOPLICA</a>
          <a href="contact.html">CONTACT</a>
        </div>
        <div class="social-media">
          <span class="iconify" data-icon="ant-design:instagram-filled" style="color: #ba4a1d;"></span>
          <span class="iconify" data-icon="ant-design:facebook-filled" style="color: #ba4a1d;"></span>
          <span class="iconify" data-icon="fluent:location-28-filled" style="color: #ba4a1d;"></span>
        </div>
        
    </header>

for space among tags use margin

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!