Css 在Shining应用程序中,图片未显示为背景

Css 在Shining应用程序中,图片未显示为背景,css,r,shiny,shinyapps,Css,R,Shiny,Shinyapps,我正在努力将SVG图像作为UI中某些div的背景。下面是我的最小闪亮应用程序- library(shiny) ui <- fluidPage( div(style = "height: 100px; width: 100px; background-image: url('https://cdn.shopify.com/s/files/1/0496/1029/files/Freesample.svg') no-repeat top left;") ) server <- fun

我正在努力将
SVG
图像作为
UI
中某些
div
的背景。下面是我的最小
闪亮应用程序
-

library(shiny)

ui <- fluidPage(
  div(style = "height: 100px; width: 100px; background-image: url('https://cdn.shopify.com/s/files/1/0496/1029/files/Freesample.svg') no-repeat top left;")
)
server <- function(input, output) {}
shinyApp(ui, server)
库(闪亮)

ui您必须使用CSS属性
background
而不是
background image
。此外,设置的尺寸太小,无法容纳图像。尝试:

library(shiny)

ui <- fluidPage(
  div(style = "height: 392px; width: 472px; background: url(https://cdn.shopify.com/s/files/1/0496/1029/files/Freesample.svg) no-repeat top left;")
)
server <- function(input, output) {}
shinyApp(ui, server)
库(闪亮)
用户界面