R Shiny - 如何从顶部定位图像

R Shiny - How to position an image from top

我使用了下面的脚本,但图像没有正确对齐,因为它与 header 不在同一行。

如何将徽标从顶部移动到所需位置?

tags$img(src="R.png", height = 50, length = 50, align = "left"),

之前我使用“ShinyUI”,现在改为“dashboardPage”,这本身就解决了问题,并且图像会自动调整和对齐。

以下是我使用的参数。

title = tags$a(href = 'https://google.com',
               tags$img(src = 'logo.png', height= 50,width= 50, align = "left"),
               'Title')

header = dashboardHeader(title = title, titleWidth = 400)


ui = dashboardPage(header, sidebar, body, tags$head(tags$link(rel = "stylesheet", type = "text/css", href = "custom1.css")))

感谢 Abhinav...

watch this video for more details