Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

element gets hidden on giving overflow to x

Even though given overflow-y visible when hovering on the child div its getting 10px hidden i want that 10px of the child should be shown.

If i removed both overflow properties its working. Whats the issue happening here how to fix it. I need overflow-x to be hidden

.page-wrapper {
  margin-top: 20px;
  border: solid 1px;
}

.offers-parent {
  height: 185px;
  overflow-x: hidden;
  overflow-y: visible;
}

.offers-child {
  width: 310px;
  height: 185px;
  background: red;
  cursor:pointer;
}

.offers-child:hover {
  transform: translateY(-10px);
}
<div class="page-wrapper">
<div class="offers-parent">
  <div class="offers-child-wrapper">
    <div class="offers-child"></div>
  </div>
</div>
</div>

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Try overflow-x:clip

.page-wrapper {
  margin-top: 20px;
  border: solid 1px;
}

.offers-parent {
  height: 185px;
  overflow-x: clip;/* changed this from hidden */
  overflow-y: visible;
}

.offers-child {
  width: 310px;
  height: 185px;
  background: red;
  cursor:pointer;
}

.offers-child:hover {
  transform: translateY(-10px);
}
<div class="page-wrapper">
<div class="offers-parent">
  <div class="offers-child-wrapper">
    <div class="offers-child"></div>
  </div>
</div>
</div>
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading