2017-05-26 121 views
2

我想在導航欄標題字段部分添加一個自定義徽標。我嘗試添加一個HTML腳本和它的工作,但徽標圖像不適合導航欄裏面親切 - 該標誌是由邊緣推下,菜單文字重疊的標識等如何在rmarkdown的導航欄標題欄中添加自定義徽標?

name: "my-website" 
output_dir: . 
navbar: 
    title: "I want to add custom logo here" 
    left: 
- text: "Home" 
+0

你可以發佈一個工作最小化的Rmarkdown文檔。 –

+0

也許你可以使用這個:https://stackoverflow.com/questions/38333691/r-markdown-putting-an-image-in-the-top-right-hand-corner-of-html-and-moving-tit – Lifka

+0

謝謝你們倆。馬丁的回答與我合作。 ) –

回答

1

嗯,我撥弄我自己是一個網站。這是爲我工作:

name: "my-website" 
navbar: 
    title: "<img id=\"logo\" style=\"width: 30px;\" src=\"dog.gif\" />" 
    left: 
    - text: "Home" 
     href: index.html 
    - text: "About" 
     href: about.html 

enter image description here

+0

太棒了!我也做到了。也許我問的太多了,但有沒有辦法忽略利潤率? –

+1

你的利潤率是什麼意思?圖像下方和上方的空間? –

0

您可以指定在YAML。例如,如果使用flexdashboard:

--- 
title: "My Website" 
output: 
    flexdashboard::flex_dashboard: 
    theme: flatly 
    logo: LOGO.png 
--- 

注意,不結垢的標誌圖像上進行的,所以應該在導航欄的尺寸範圍內完全適合(48個像素高默認「COSMO」的主題,其他主題可能會有略微不同的導航欄高度)。