删除闪亮应用标题中的div

问题描述 投票:4回答:2

我正在使用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"/>
html r header shiny shinydashboard
2个回答
4
投票

由于您要覆盖仪表板的标题,因此必须使用tags$title明确提及页面标题>

tags$title('This is my page')

对于shinydashboard

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

0
投票

最佳解决方案如下:

© www.soinside.com 2019 - 2024. All rights reserved.