Option 1:
Setting the height for the scrollable div seems to solve the problem:
Working example 1
<div style="overflow: auto; border: 1px solid black; height:65px;"> <div style="width: 110%; height: 20px;">Wide content causing horizontal scrolling...</div> <button class="btn">Hover Me</button> </div>
Option 2:
Use overflow-x:scroll; instead of overflow:auto; :
Working example 2
<div style="overflow-x: scroll; border: 1px solid black;"> <div style="width: 110%; height: 20px;">Wide content causing horizontal scrolling....</div> <button class="btn">Hover Me</button> </div>
Option 3:
Probably the best option, as it allows the shadow screen to be visible in IE9.
Wrap the button in a div with the .btn class, rather than placing the class directly on the button.
Working example 3
.btn { display:inline; } .btn:hover { display:inline-block; border-radius:2px; box-shadow: 0 0 0 2px #b1b3b4; } <div style="overflow: auto; border: 1px solid black;padding:2px;"> <div style="width: 110%; height: 20px;">Wide content causing horizontal scrolling...</div> <div class="btn"> <button>Hover Me</button> </div> <div class="btn"> <button>Hover Me</button> </div> <div class="btn"> <button>Hover Me</button> </div> </div>
Option 4:
Just for a laugh ...
Working example 4
apaul
source share