Home > OS >  How to make div fit correctly each time?
How to make div fit correctly each time?

Time:08-11

As you can see in the screenshot I have a white space that is created sometimes on the right and sometimes on the top. And sometimes everything looks good. I just want this 2 div to fit correctly, How can I do ?

White space on top

I have one div with border radius and inside of it another div that contain the text and the number

Parent div:

 border: 2px solid;
  overflow: hidden;
  border-radius: 10px;
  border-color: rgb(229, 184, 11);

Child div:

display: flex;
  flex-direction: row;
  gap: 1vw;
  float: right;
  border-bottom-left-radius: 10px;
  margin: 0;

I tried to increase height of child div, add padding margin etc... but none of this solutions worked. How can I fix this behavior ?

CodePudding user response:

You can do the trick by set margin: -1px for the child div.

CodePudding user response:

make you parent relative position then absolute your child position top,right zero

  • Related