【问题标题】:Add image with link in Github's README.md?在 Github 的 README.md 中添加带有链接的图像?
【发布时间】:2020-07-19 02:55:14
【问题描述】:

如何在 Github 的 README.md 上添加同时作为外部页面链接的图像?

添加降价以显示图像非常简单(在Add images to README.md on GitHub 回答)。添加链接也很简单(GitHub relative link in Markdown file),但似乎无法添加同时作为外部站点链接的图像。

<a href="https://stackoverflow.com/"><img src="RELATIVE_PATH_TO_IMAGE></img></a>

【问题讨论】:

    标签: github markdown readme


    【解决方案1】:

    试试简单的语法:

    [![name](link to image on GH)](link to your URL)
    

    这会将图像包装为链接

    【讨论】:

      【解决方案2】:

      一些额外的混合 html 和 markdown 的语法,让您可以更灵活地调整图像的显示方式。

      假设你的 repo 结构如下(它只是指下面语法中使用的相对链接):

      example repo structure

      你可以使用

      [<img alt="alt_text" width="40px" src="images/image.PNG" />](https://www.google.com/)
      

      【讨论】:

        猜你喜欢
        • 2013-01-07
        • 2019-02-03
        • 1970-01-01
        • 1970-01-01
        • 2017-10-26
        • 2013-03-22
        • 1970-01-01
        • 2018-11-22
        • 1970-01-01
        相关资源
        最近更新 更多