0

I have one div inside another. The inner div is larger than the outer div, and I want the outer div to scroll to show the hidden content. I marked it as overflow: auto and it works fine.

However, I also need scrollbars to appear on the outer div due to business constraints. This works in all browsers on Windows. It also works in Firefox on Mac. On Safari/Chrome on Mac I expect to see the scrollbars appear when I scroll the div's content, just like they do when I scroll any web page. What happens instead is that I can scroll the content but scrollbars never appear. What do I have to do to get scrollbars to show up properly?

Here's what I have:

<style type="text/css">
.inner {
    width: 300px;
    height: 300px;
}
.outer {
    width: 100px;
    height: 100px;
    overflow: auto;
}
</style>

<div class="outer">
<div class="inner">asdf qwer qwer asdf</div>
</div>
Paul Shealy
  • 734
  • 3
  • 8
  • Does `overflow: scroll;` work? – Brendan Sep 05 '12 at 15:54
  • @Brendan no, it doesn't. A fiddle for his example. http://jsfiddle.net/yxAzA/ – Gidgidonihah Sep 05 '12 at 15:55
  • They appear when I scroll (Mac/Chrome) – Quentin Sep 05 '12 at 16:31
  • Is this questions answer relevant? http://stackoverflow.com/a/7855592/600101 *I edited the link to go directly to the answer*. – Henrik Ammer Sep 05 '12 at 16:33
  • I was going to add what @HenrikAmmer said as an answer. The other option is to plug a mouse into the Mac :) – user1337 Sep 05 '12 at 17:09
  • @Quentin For me (Lion/Safari or Lion/Chrome) the scrollbars do not appear when scrolling at all. Screenshot taken while scrolling. http://cl.ly/image/26212n1a241b – Gidgidonihah Sep 05 '12 at 21:40
  • Possible duplicate of [Preventing scroll bars from being hidden for MacOS trackpad users in WebKit/Blink](https://stackoverflow.com/questions/7855590/preventing-scroll-bars-from-being-hidden-for-macos-trackpad-users-in-webkit-blin) – sinaza Jun 14 '18 at 16:59

2 Answers2

-1

I think overflow:scroll; will work .

sasi350
  • 43
  • 1
  • 5
-1

I wasn't able to sort out why... but I went @HenrikAmmer's answer. That's good enough for my solution.

Paul Shealy
  • 734
  • 3
  • 8