我尝试使用以下代码将内容插入水平可滚动div:
<div id="scrolly">
<div id="chartdiv_hourly" class="vh72" style="width:200%;">
</div>
</div>
#scrolly{
width: auto;
overflow: auto;
height: auto;
white-space: nowrap;
}
chartdiv_hourly
width: 200%;
overflow: hidden;
text-align: left;
问题是我无法在真实设备上水平滚动。
我试图找到任何解决方案,我发现: https://github.com/davidaurelio/TouchScroll
但是库似乎已经过时,所以我试图在纯CSS中找到解决方案,是否可能?
感谢您的帮助..
答案 0 :(得分:0)
您正在使用自动溢出。
使用此:
overflow: scroll;
祝你好运。
答案 1 :(得分:0)
'scrolly'需要设置绝对宽度。设置为auto,我希望它能够适应孩子的内容。