【问题标题】:Remove double scrollbar on block extension删除块扩展上的双滚动条
【发布时间】:2021-05-24 11:32:19
【问题描述】:

我有一个非常简单的项目结构,我使用 django-plotly-dash 包在 django 上打包了一个 plotly-dash 应用程序。我已经进行了几次测试,并且已经将所有内容都设置为正常工作,但是当插入破折号应用程序时,会出现一个双滚动条。这是我的代码简历:

base.html

<!DOCTYPE html>
<html lang="es">
<head>
    <meta charset="UTF-8">
    <title>Dash App</title>
    <script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
</head>
<body>
    {% block content %}

    {% endblock %}
</body>
</html>

dashboard.html

{% extends 'base.html' %}
{% load plotly_dash %}

{% block content %}
    <div class="{% plotly_class name='dash-app' %}" style="height: 100%; width: 100%;">
        {% plotly_app name="dash-app" ratio=1 %}
    </div>
{% endblock %}

Here你可以看到我提到的双滚动条。

知道如何删除一个以便插入的应用使用与浏览器页面相同的应用吗?

【问题讨论】:

    标签: css django django-views scrollbar


    【解决方案1】:

    您可以在 css 中移除滚动条。

    .dash-app::-webkit-scrollbar {
      display: none;
    }
    

    您需要使用其他浏览器前缀才能使其正常工作。

    参考:https://developer.mozilla.org/en-US/docs/Web/CSS/::-webkit-scrollbar

    【讨论】:

    • 这对我来说不是诀窍,我在几个浏览器上测试了它:(
    • 你用什么浏览器截屏的?
    • Firefox,但我也在 Chrome 上进行了测试,它应该与 css 属性完全兼容
    • 在 div 上尝试overflow-y: hidden;。这将隐藏滚动条。
    猜你喜欢
    • 2012-11-12
    • 2013-10-24
    • 2015-11-25
    • 2011-07-30
    • 2016-05-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多