我正在使用 GitHub 存储我的图像并创建一个 Markdown 文件,以便部署到微型网站。我使用的代码在 GitHub 的预览模式下看起来不错(有下拉菜单和可点击的图像),但我的微型网站不显示图像,我不明白为什么。
我正在使用 MkDocs 材质。在我的 GitHub 的 markdown 文件中:
<details>
<summary>Click to expand dropdown</summary>
<div class="image-container">
<a href="https://google.com">
<img src="Google_media/logo.png" alt="Google" width="350" height="200">
</a>
</div>
</details>
这是它在微型网站上的样子。如何让我的图片显示在微型网站上?
我在下拉菜单之外使用传统的 MD 和 HTML 图像调用测试了该图像,效果很好:
在降价中:
[![logo](Google_media/logo.png 'logo')](https://google.com)
在 HTML 中:
<a href="https://google.com">
<img src="Google_media/logo.png" alt="logo" width="350" height="200">
</a>
CSS:
style="content:url('/path/to/file.png')
<details>
<summary>Click to expand dropdown</summary>
<div class="image-container">
<a href="https://google.com">
<span style="content:url('/path/to/file.png');width:100px;height:100px"></span>
</a>
</div>
</details>