Markdown `native` text alignment

后端 未结 11 1212
有刺的猬
有刺的猬 2020-11-28 04:36

Does markdown support native text-alignment without usage html + css?

相关标签:
11条回答
  • 2020-11-28 05:12

    In Github You need to write:

    <p align="justify">
      Lorem ipsum
    </p>
    
    0 讨论(0)
  • 2020-11-28 05:15

    It's hacky but if you're using GFM or some other MD syntax which supports building tables with pipes you can use the column alignment features:

    || <!-- empty table header -->
    |:--:| <!-- table header/body separator with center formatting -->
    | I'm centered! | <!-- cell gets column's alignment -->
    

    This works in marked.

    0 讨论(0)
  • 2020-11-28 05:20

    For Markdown Extra you can use custom attributes:

    # Example text {style=text-align:center}
    

    This works for headers and blockquotes, but not for paragraphs, inline elements and code blocks.

    A shorter version (but not supported in HTML 5):

    # Example text {align=center}
    
    0 讨论(0)
  • 2020-11-28 05:20

    I was trying to center an image and none of the techniques suggested in answers here worked. A regular HTML <img> with inline CSS worked for me...

    <img style="display: block; margin: auto;" alt="photo" src="{{ site.baseurl }}/images/image.jpg">
    

    This is for a Jekyll blog hosted on GitHub

    0 讨论(0)
  • 2020-11-28 05:21

    I found pretty useful to use latex syntax on jupyter notebooks cells, like:

    ![good-boy](https://i.imgur.com/xtoLyW2.jpg  "Good boy on boat")
    
    $$\text{This is some centered text}$$
    
    0 讨论(0)
提交回复
热议问题