【问题标题】:Adding a background image to a Dashboard using dash/plotly wipes out content使用破折号/绘图将背景图像添加到仪表板会消除内容
【发布时间】:2021-01-22 21:30:00
【问题描述】:

我正在尝试将背景图像添加到我的 Dash/Plotly 仪表板。我通过使用以下内容修改 css 来做到这一点:

body {
  height:100%;
  background-image: url("/assets/rink.jpg");
  background-size: cover;
  background-position: center top;
  position: fixed;}

这会显示图像 - 它看起来很棒 - 但它会清除仪表板上的所有其他内容。怎么把图片推到后台(我想发到后面)?

谢谢

【问题讨论】:

  • 很难说没有看到 HTML,但也许看看z-index。如果确实是堆叠问题,则添加 z-index: -1 可能会起作用。

标签: html css plotly-dash


【解决方案1】:

我想通了。我在 html.Div([],style='body') 中提到了 css。我删除了 style='body',现在它真的在背景中并且看起来很棒!

【讨论】:

    猜你喜欢
    • 2013-02-16
    • 1970-01-01
    • 2012-11-27
    • 2021-10-14
    相关资源
    最近更新 更多