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

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

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 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