【问题标题】:Add hyperlink to PNG inside flexdashboard在 flexdashboard 中添加指向 PNG 的超链接
【发布时间】:2021-01-28 03:15:07
【问题描述】:

我想为我添加到我的 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")
```

此外,如果有人知道如何使这张图片更小并在其周围环绕文字,那就太好了。

【问题讨论】:

    标签: html r hyperlink png flexdashboard


    【解决方案1】:

    添加href 属性。 这应该工作

    【讨论】:

      【解决方案2】:

      我已经通过使用@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 = 为图标添加超链接并缩小图标

      【讨论】:

        猜你喜欢
        • 2019-01-07
        • 1970-01-01
        • 2022-12-06
        • 2012-06-30
        • 1970-01-01
        • 2020-05-08
        • 1970-01-01
        • 2021-06-04
        • 2013-03-29
        相关资源
        最近更新 更多