Jekyll kramdown how to center text

vancexu picture vancexu · Feb 3, 2015 · Viewed 7.1k times · Source

I am using Jekyll (kramdown), and want to make some text align center.

I found <span style=""> works for font color and size, but not work for text-align.

How can I align some text.

I have tried:

<span style="color:gray; font-size: 80%; text-align: center;">Test Text</span>

And:

-> Test Text <-

None of them work.

Answer

David Jacquel picture David Jacquel · Feb 3, 2015

Try using kramdown block attributes kramdown block attributes :

Test text
{: style="color:gray; font-size: 80%; text-align: center;"}