Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

223
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!