Adding background image to Shiny NavBarPage

Viewed 8275

I'm trying to add a background image to a Shiny App. I need it fixed into the top left corner. So far the background image is not loading. The color is loading and the font appears to be fine. Just no image.

This is my CSS:

body {
  background-image: url("header.png");
  background-position: left top;
  background : #000000; 
}

and here is where I'm including it in my Shiny:

ui = navbarPage(
  includeCSS("includes/style.css"),

Thanks in advance for the help.

3 Answers

Use the following code in ui.R file if the image is located in www folder of the project-

 tags$style(
HTML(
paste0(
"body{
      background: url('./(Image-name.extension)') no-repeat center center fixed;

     }"
    )))
Related