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

229
Visualizações
tailwind overlay grid take 100% of parent

Just trying to get myself familiarized with tailwind.

I have got a grid component in my React.Js project. The main purpose of this is to draw some vertical lines as an overlay. Here is what it looks like:

//hours are just some hours of the day
 return (
    <div className="w-full h-full inline-flex absolute">
      <div className="w-10" />
      {
        hours.map(_ =>
          <div className="flex-grow border-l-2 border-black h-full" />)
      }
    </div>);

Now I've a parent component, which has this grid component like:

const ParentX = ({ children }: Props) => {
  return (
    <div>
      <GridX />
      {
        children
      }
    </div>);
};

export { ParentX };

Now the problem I'm facing is, I want the grid to take height only the height parent is taking, noting more than that. So I put h-full. And the parent will take the height of the parent's children, JSX elements passed as props. Instead, it's taking the whole screen.

Here is a snap: enter image description here

The end of those horizontal lines is the end of those child components. So my question is, why the vertical line is taking the full height? How can I just fill the parent?

about 4 years ago · Juan Pablo Isaza
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