Home > database >  Div scroll even on hover
Div scroll even on hover

Time:08-08

I have a div A
where another div B is present inside A

when I hover the div B it will be hidden.

but when I am hovering over B
I cannot scroll over div A.

Is there a way I can remove this using CSS?

CodePudding user response:

You can try disabling pointer-events on B.

.a:hover b {
  pointer-events: none;
}

CodePudding user response:

Completely extrapolating your intention here but is this what you are aiming for?

.a {
  position: relative;
  background: #eee;
  max-height: 300px;
  height: 500px;
  width: 200px;
  overflow: scroll;
}

.b {
  position: fixed;
  top:10px;
  left:10px;
  background: #edf;
  height: 80px;
  width: 100px;
  pointer-events: none;
}

.b:hover {
  opacity: 0;
}
<div >
  Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.
  <div >
    B
  </div>
  It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop
  publishing software like Aldus PageMaker including versions of Lorem Ipsum.
</div>

  • Related