Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

312
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar

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 Denunciar

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda