How to use the parent component <Card> its height? Ant design

Viewed 191
<Card style={{height: "500px"}} > 
  <div style={{height:"100%"}} >
    Lorem ipsum
  </div>
</Card>

For some reason, the div does not detect the cards height.

So how can I reference the Cards height? I need to set my childrens height depending on the parent height. If I dont, it just goes off the Card component.

1 Answers

what ever you have done is correct, but you have n't specified the width for both parent and children. So it is not looking like as expected, but currently the child is taking full parent height, provide width to both parent and children

.parent {
    height: 100px;
    width: 100px;
    background-color: red;
}
.child {
    height: 100px;
    width: 50px;
    background-color: aqua;
}
Related