Markdown to Center text?

How can I center text on a web page with Markdown? I can’t seem to find how to do that. If not Markdown, how could I do it with CSS?

Also, can I mix Markdown with CSS on the same web page?

Thank you,

Gina

For the CSS part…

3 Likes

Aris, thanks – I added the block of code for centering inline text to the Custom CSS section on my blog, but I’m not sure how to apply it to the specific headlines I’m trying to center. I’m assuming I need to be adding the code to the CSS Section, but that’s about as far as I get. On top of it, I know very little about CSS language. If you have any other advice, I appreciate it. Gina

.center-children { text-align: center; }

I have found the following to work for centering. I use it for centering images.

<div style="text-align:center;width:100%;">insert text here</div>
3 Likes

Thank you. It works, but can I make it bold? It’s been many months, but thanks. How do I make it bold, as well? Nothing is working for me.

Hi @writedirt! All you have to do is continue to use HTML. So in this case you’d wrap the text in the bold tag like so:

<div style="text-align:center;width:100%;"><strong>insert bold text here</strong></div>

Hope that helps!

1 Like

Ah, thank you, cjeller1592. That is so great to know. May I ask, is it possible to control text size this way, as well? Much appreciated.

This doesn’t work if you’re trying to align an image?

@arshbot what’s the full code you’re using to try and center an image?

Hey matt! I played around a bit more and figured it out, tho it wasn’t obvious to me. I’ll post my solution here for reference

<div style="text-align:center;width:100%;"> ![Buckle Up Buckaroo GIFs | Tenor](https://c.tenor.com/65sQ5wAiU78AAAAC/buckleup-buckaroo.gif)
1 Like