Jim*_* O. 8 html css r-markdown
我想在导航栏标题字段部分添加自定义徽标。我尝试添加一个 html 脚本并且它起作用了,但是徽标图像不适合导航栏 - 徽标被边距推开,菜单文本与徽标重叠,等等。
name: "my-website"
output_dir: .
navbar:
title: "I want to add custom logo here"
left:
- text: "Home"
Run Code Online (Sandbox Code Playgroud)
好吧,我自己摆弄了一个网站。这对我有用:
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
Run Code Online (Sandbox Code Playgroud)
您可以在 YAML 上指定。例如,如果使用 flexdashboard:
---
title: "My Website"
output:
flexdashboard::flex_dashboard:
theme: flatly
logo: LOGO.png
---
Run Code Online (Sandbox Code Playgroud)
请注意,徽标图像没有进行缩放,因此它应该完全适合导航栏的尺寸(默认“cosmo”主题为 48 像素高,其他主题的导航栏高度可能略有不同)。