问题描述
我想向我添加到flexdashboard的PNG添加超链接功能。 我已经设法将超链接添加到文本,如下面的代码所示(在第一部分中),但我想将其添加到代码第二部分中添加的PNG图标中
---
title: "PNG Hyperlink"
output:
flexdashboard::flex_dashboard:
orientation: columns
vertical_layout: fill
---
```{r setup,include=FALSE}
library(flexdashboard)
```
# Homepage
## Column {data-width=500}
### Introduction
<font size = "5">Please read user manual before exploring this dashboard. You can find user manual by clicking <a href="file:///C:/Users/Filip/Desktop/Dashboard%20guide.htm" target=_blank>here</a></font><br><br><br>
### Introduction 2
<font size = "5">Please read user manual before exploring this dashboard. You can find user manual by clicking the following icon</font><br><br><br>
```{r}
knitr::include_graphics("document-icon.png")
```
此外,如果有人知道如何缩小图片尺寸并环绕文字环绕,那就太好了。
解决方法
添加一个href
属性。
这应该工作
我通过使用@samarmohan
输入后的代码设法解决了这个问题。
这是代码
### Introduction 2
<font size = "5">Please read user manual before exploring this dashboard. You can find user manual by clicking the following icon</font><br><br><br>
<a href="file:///C:/Users/Filip/Desktop/Dashboard%20guide.htm" target=_blank><center>
```{r dpi=10}
knitr::include_graphics("document-icon.png")
```
</center></a>
我添加了href
,以便为图标添加超链接,并在{r}框内使用dpi =
来缩小图标