Jekyll right align text

好久不见. 提交于 2019-12-07 12:32:28

问题


How do you right align text in Jekyll?

I have a block of text I want to right align.

If it was HTML, I'd do something like:

style="text-align:right;"

How can I do that in Markdown with Jekyll?


回答1:


Jekyll 2.0+ uses kramdown as a default markdown converter.

You can declare right align in your css:

.right{
     text-align: right;
}

Then, simply add after your paragraph:

This text is right aligned. {: .right}



回答2:


You will have to use HTML tags for that, e.g. <p style="text-align: right">. Markdown can align table contents by putting a colon in the separator line (left, right, both ends), but not normal text, AFAIK.




回答3:


Jekyll supports Textile language, so you can use the specific tags for paragraphs, in your case the tag to align on the right p>..

In the linked page:

p>. Aligned right paragraph.


来源:https://stackoverflow.com/questions/24254846/jekyll-right-align-text

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!