闪亮的页面标题和图像

LBV*_*LBV 3 r shiny

我的UI代码如下:

ui <- navbarPage(
theme = shinytheme("paper"),
title = div(img(src="ballerlablogo.png", style="margin-top: -14px;", height = 50)),

...

)
Run Code Online (Sandbox Code Playgroud)

效果很好,但是网页选项卡上的标题看起来像这样:

标签标题

有没有一种方法可以使页面标题成为“ Baller Lab”而又不会在导航栏中删除图像或在导航栏中添加“ baller lab”文本?

这是该网站的链接:BallerLab.us

A. *_*man 5

使用fluidPage可以tags$head修改网页标签上的标题

library(shiny)
library(shinythemes)
ui <- fluidPage(
  theme = shinytheme("paper"),
  tags$head(HTML("<title>Baller Lab</title>")), #Without company logo
  #tags$head(HTML("<title>Baller Lab</title> <link rel='icon' type='image/gif/png' href='ballerlablogo.png'>")), #WIth company logo
  navbarPage(title = div(img(src="ballerlablogo.png", style="margin-top: -14px;", height = 50))))

server <- function(input, output, session) {}

shinyApp(ui, server)
Run Code Online (Sandbox Code Playgroud)

  • @a-suiman 啊哈,我们正在谈论网站图标!我以为你想在标题元素中放置一个图像!好吧,您还可以将图标堆叠在嵌套的 R 函数中: `tags$head(tags$link(rel = "icon", type = "image/gif/png", href = "ballerlablogo.png")), Tags $head(标签$title(“Baller Lab”))` (2认同)