如何解决在flexdashboard内将超链接添加到PNG
我想向我添加到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 =
来缩小图标
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。