删除闪亮应用程序标题中的div

时间:2017-10-04 08:41:20

标签: html r header shiny shinydashboard

我正在使用shinydashboard,我想在标题中添加以下代码:

header <- dashboardHeader(
  title = div(img(src = 'logo.png',
                  height = 60,
                  width = 120))
)

一切顺利,但当我通过Chrome打开应用程序时,在我的浏览器标签中,它看起来很奇怪,如下所示。

enter image description here

有没有办法阻止它在浏览器上显示并显示一些正常文字?

<div> <img src="logo.png" height="60" width="120"/>

2 个答案:

答案 0 :(得分:4)

由于您正在覆盖Dashboard的标题,因此您需要使用tags$title明确提及页面标题

tags$title('This is my page')

shinydashboard

ui <- dashboardPage(title = 'This is my title', header, sidebar, body, skin='red')

答案 1 :(得分:0)

最好的解决方案可能是:

header <- dashboardHeader(
    title = HTML('<div> <img src="logo.png" height="60" width="120"/>')
)