Jump to content

How do I center the text from my HTML code in Markdown?

Recommended Posts

I am trying to create a header featuring four links to reference points below on a page in my website. I've gotten the words appropriately spaced and I now only need to center the four words. I've attached a screenshot of my conundrum as my site is not yet live. I'd like the top four words (the HTML references) to match the bottom four words (just plain old text that is centered) Any help is appreciated!alt text

Link to comment
  • Replies 5
  • Views 39.9k
  • Created
  • Last Reply

Your site has a url which you will find in Settings > Domains > Built-In Domain. Post that url here.

I'm a retired attorney who was asked by a friend to build a website. In a prior lifetime, in a galaxy far, far away and long, long ago, I was a computer systems analyst / programmer. I'm a novice autodidact in CSS, JavaScript and HTML learning in part by example.. I've asked questions on this forum and been lucky enough to have others help me, so I'm inclined to answer any question I can. Pay it forward.

Link to comment
  • 2 months later...
  • 3 weeks later...

There is, though, a way in Markdown to center text but it involves a little elementary HTML. One surrounds the text to be centered with a div having these attributes: style="text-align: center;" markdown="1".

Thus:

<div style="text-align: center;" markdown="1">This line is centered.  This second line too.  (for a line-break, end the prior line with two spaces)</div>This following text will be left justified by default.

Or, for example,

<h3 style="text-align: center;" markdown="1">This is a level 3 heading.</h3>

Experiment with a code block.

Some authors say, though, that CSS is the better practice. The Ghost Blogging Support Forum: Justified Text.

I'm a retired attorney who was asked by a friend to build a website. In a prior lifetime, in a galaxy far, far away and long, long ago, I was a computer systems analyst / programmer. I'm a novice autodidact in CSS, JavaScript and HTML learning in part by example.. I've asked questions on this forum and been lucky enough to have others help me, so I'm inclined to answer any question I can. Pay it forward.

Link to comment
  • 2 months later...
  • 8 months later...

This is so close to working for me! My only issue is that I want it to be the normal body copy. Any idea what the style is for that instead of h3? I tried a few things and didn't have much luck without drastically altering the spacing.

Link to comment

Archived

This topic is now archived and is closed to further replies.

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.