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

183
Vistas
Keeping a div at the bottom of it's parent always

My Component

return (
    <div>
      <section>
        <div class="md:grid md:grid-cols-2 gap-4">
          {pinnedRepos.map((r) => {
            const bgColor = {
              backgroundColor: r.node.primaryLanguage.color,
            };

            return (
              <div
                id="project-outer-container"
                class="text-sm border-solid border border-gray-300 rounded shadow mb-4 md:mb-0 pb-4">
                <div id="project-inner-container" class="p-4 relative">
                  <div id="project-title" class="flex items-center">
                    <span class="mr-3 text-xl">
                      <GoRepo />
                    </span>
                    <a href={r.node.url}>{r.node.name}</a>
                  </div>
                  <div class="flex flex-col justify-between">
                    <div id="project-about" class="">
                      <p class="">{r.node.description}</p>
                    </div>
                    <div id="project-lang" class="flex items-center content-end">
                      <div style={bgColor} class="rounded-full h-3 w-3"></div>
                      <span class="ml-3">{r.node.primaryLanguage.name}</span>
                    </div>
                  </div>
                </div>
              </div>
            );
          })}
        </div>
      </section>
    </div>
  );

I want to keep this section...

<div id="project-lang" class="flex items-center content-end">
                      <div style={bgColor} class="rounded-full h-3 w-3"></div>
                      <span class="ml-3">{r.node.primaryLanguage.name}</span>
                    </div>

at the bottom of its parent always. Otherwise I end up with stuff like this:

enter image description here

which just looks messy. I have tried multiple flexbox alignments and justified rulings. I have set the parent element to absolute and the child to a relative still nothing.

I have even tried the way of using a sticky footer but nope.

Any CSS wizards to move me in the right direction would be great

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

With the tip of above this is how I managed to do it

<div
                id="project-outer-container"
                class="text-sm border-solid border border-slate-300 dark:border-slate-700 rounded shadow mb-4 md:mb-0 pb-4">
                <div id="project-inner-container" class="p-4 h-full relative">
                  <div id="project-title" class="flex items-center">
                    <span class="mr-3 text-xl">
                      <GoRepo />
                    </span>
                    <a href={r.node.url}>{r.node.name}</a>
                  </div>
                  <div id="project-about" class="">
                    <p class="">{r.node.description}</p>
                  </div>
//----------------- this is what I wanted to be placed at the bottom
                  <div id="project-lang" class="flex items-center absolute bottom-0">
                    <div style={bgColor} class="rounded-full h-3 w-3"></div>
                    <span class="ml-3">{r.node.primaryLanguage.name}</span>
                  </div>
                </div>
              </div>
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