Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

313
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda