所以目前我有:
#div {
position: relative;
height: 510px;
overflow-y: scroll;
}
Run Code Online (Sandbox Code Playgroud)
但是我不相信某些用户会明白那里有更多的内容.他们可以在不知道我的div实际上包含更多内容的情况下向下滚动页面.我使用高度510px,以便它切断一些文本,所以在某些页面上看起来确实有更多内容,但这并不适用于所有这些内容.
我正在使用Mac,而在Chrome和Safari中,垂直滚动条只会在鼠标悬停在Div上时显示,并且您会主动滚动.有没有办法让它一直显示?
自10.7(Mac OS X Lion)以来MacOS上的WebKit/Blink(Safari/Chrome)默认行为是在不使用触控板用户时隐藏滚动条.这可能令人困惑 ; 滚动条通常是元素可滚动的唯一视觉提示.
<div class="frame">
Foo<br />
Bar<br />
Baz<br />
Help I'm trapped in an HTML factory!
</div>
Run Code Online (Sandbox Code Playgroud)
CSS
.frame {
overflow-y: auto;
border: 1px solid black;
height: 3em;
width: 10em;
line-height: 1em;
}?
Run Code Online (Sandbox Code Playgroud)
WebKit(Chrome)截图


如何强制滚动条始终显示在WebKit中的可滚动元素上?
我object在html中有一个标记位置,如下所示:
<div class="viewport" id="pdf-viewport">
<object class="pdf-object" data="PDF_URL_HERE" type="application/pdf"></object>
</div>
Run Code Online (Sandbox Code Playgroud)
我的桌面上的观看体验还可以,但我无法在移动设备上滚动pdf.如何添加此功能?我试过CSS和溢出但我想我错过了什么.
编辑
我尝试使用GoogleDocs/GoogleDrive在iFrame中嵌入pdf,但它给了我Preview not available太多次,所以它不可靠.
我有一个样式表并使用overflow:scroll; 在我的CSS中混合滚动条.它适用于Firefox,但不适用于Safari浏览器中的iPad.在那里,没有显示滚动条,但可以用两个手指滚动.
现在,iPad不显示滚动条是正常的吗?不管怎样,这将是愚蠢的.
textarea中的垂直滚动条显示在IE,FF和Chrome中,但不显示在ipod/ipad等i-os设备中.
<textarea id="termsConditions" cols="30" rows="5" readonly="readonly">Sample text sample text sample text sample text sample text sample text sample text sample text sample text sample text sample text sample text sample text sample text sample text sample text sample text sample text sample</textarea>
Run Code Online (Sandbox Code Playgroud)
如何解决这个问题?
非常感谢提前.