【问题标题】:Why Markdown does not align image properly?为什么 Markdown 不能正确对齐图像?
【发布时间】:2020-07-25 11:34:29
【问题描述】:

我在 Github markdown 中使用下面的行来获取对齐的图像,但是即使有空间,最后一张图像也总是会断行。

代码

# Example Img alightment #
<img align="left" src="https://github.com/hissain/CoronaTracker/blob/master/architecture/Screenshots/Android/Screenshot_Registration.png" alt="Android Registration" width="200"/>
<img align="center" src="https://github.com/hissain/CoronaTracker/blob/master/architecture/Screenshots/Android/Screenshot_Registration.png" alt="Android Registration" width="200"/>
<img align="right" src="https://github.com/hissain/CoronaTracker/blob/dev/architecture/Screenshots/Android/Screenshot_Registration.png" alt="Android Registration" width="200"/>

输出

如何将所有三个图像对齐在一行中?

参考:https://github.com/hissain/CoronaTracker/blob/dev/architecture/example.md

【问题讨论】:

    标签: image github alignment markdown line-breaks


    【解决方案1】:

    如果您只需要它们在一行而不居中,您可以执行以下操作(只需放置不带新行或带有&lt;p&gt; 标签的图像):

    <img src="https://github.com/hissain/CoronaTracker/blob/master/architecture/Screenshots/Android/Screenshot_Registration.png" alt="Android Registration" width="200"/> <img src="https://github.com/hissain/CoronaTracker/blob/master/architecture/Screenshots/Android/Screenshot_Registration.png" alt="Android Registration" width="200"/> <img src="https://github.com/hissain/CoronaTracker/blob/dev/architecture/Screenshots/Android/Screenshot_Registration.png" alt="Android Registration" width="200"/>
    

    <p>
      <img src="https://github.com/hissain/CoronaTracker/blob/master/architecture/Screenshots/Android/Screenshot_Registration.png" alt="Android Registration" width="200"/>
      <img src="https://github.com/hissain/CoronaTracker/blob/master/architecture/Screenshots/Android/Screenshot_Registration.png" alt="Android Registration" width="200"/>
      <img src="https://github.com/hissain/CoronaTracker/blob/dev/architecture/Screenshots/Android/Screenshot_Registration.png" alt="Android Registration" width="200"/>
    </p>
    

    【讨论】:

    • 感谢 ilua.lehchylin,尽管我还不知道我的方法中问题的根本原因。
    猜你喜欢
    • 2017-01-31
    • 2018-05-24
    • 2010-11-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-09-20
    • 1970-01-01
    • 2023-03-12
    相关资源
    最近更新 更多