问题
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