【问题标题】:Image not aligning with the text on GitHub Pages图片与 GitHub Pages 上的文字不对齐
【发布时间】:2020-09-28 00:59:55
【问题描述】:

图像与 GitHub Pages 上的文本不对齐,但在 GitHub 存储库上看起来不错。

如下所示,图像与项目符号和文本对齐

当我使用 GitHub Pages 的 Dinky 主题创建网站时,图像不再对齐。

我该如何解决这个问题?

有什么方法可以在不更改 GitHub Pages 主题或使用 Gem 的情况下解决此问题?

我认为使用 html 上传图片可以,但图片不会显示在网站上。

这是我的Repository 的链接。它是用韩文写的,但图片在 1867-1868 行

谢谢

【问题讨论】:

    标签: html github markdown github-pages github-flavored-markdown


    【解决方案1】:

    根据GFM specs (GitHub Flavored Markdown) 的问题,图片链接![foo](/url "title") 语法会在段落 内生成图片链接。

    <p><img src="/url" alt="foo" title="title" /></p>
    

    Using html 可能是更好的选择:

    text... <img alt="Image alt text" title="Optional image title"
         src="https://username.github.io/repo-name/img/pic.jpg "
    /> ... text
    

    【讨论】:

    • 感谢您的回答。但是在项目符号点内添加图像时,图像仍然关闭并且未与项目符号点中的文本对齐。所以我添加了align="center" 这样的&lt;img alt=”Image alt text” title=”Optional image title” src=”https://raw.githubusercontent.com/dounykim/MDcheck4/master/img/ec-2_.png align=”center” /&gt;。然后,它不再被识别为图像。
    • @DoHunKim " 然后,它不再被识别为图像":那是因为您忘记了文件名后的右引号:src="https://raw...._.png" align="center" /&gt;:注意.png 后面的",在你的情况。
    • 哦,对了。我只是想通了。但是align="center"align="bottom" 都没有将图像与项目符号内的文本对齐。
    • 是否无法将图像与项目符号内的文本对齐?不使用项目符号时一切正常
    • @DoHunKim 我怀疑与 li 关联的默认 stype 在这里有问题。尝试添加stackoverflow.com/a/28629341/6309 中的样式。
    猜你喜欢
    • 2017-05-09
    • 1970-01-01
    • 2021-02-05
    • 2023-01-24
    • 1970-01-01
    • 2021-12-27
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多