如何在Shiny R中的徽标前面显示标题

时间:2015-02-21 20:08:42

标签: html css r position shiny

因此,以下代码将标题写在徽标下,而我希望它位于徽标的前面。在RStudio的titlePanel帮助中,没有关于定位标题的帮助。对此有何影响?

shinyUI(fluidPage(
  list(tags$head(HTML('<img src="http://ic.pics.livejournal.com/oddharmonic/554743/66688/66688_600.gif" border="0" style="border:2px width="10"  height="10"   alt="Photo of Milford Sound in New Zealand!" />'))),
  div(style="padding: 0px 0px",
      titlePanel(
        title="University of Wisconsin-Madison Database Group", windowTitle="FML"
      )
  ),

这就是现在的样子: enter image description here

1 个答案:

答案 0 :(得分:1)

这是我能想到的。您可以将<img />标记包含在<h1>...</h1>内,如下所示:

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

ui <- shinyUI(fluidPage(
    list(tags$head(HTML('<h1> <img src="http://ic.pics.livejournal.com/oddharmonic/554743/66688/66688_600.gif" border="0" style="border:2px width="10"  height="10"   alt="Photo of Milford Sound in New Zealand!"/> University of Wisconsin-Madison Database Group</h1>')))
))

shinyApp(ui = ui, server = server)