Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Advanced Search
  • 2
mrobinson99

Change background color of Text Block?

Question

13 answers to this question

Recommended Posts

  • 3

tazmeah’s suggestion of Markdown blocks is fantastic. You can also insert divs with your own styling such as background colors. Note that if you put two Markdown blocks next to each other, Squarespace will automatically merge them for you into one Markdown block.

So here’s an example of two text blocks with custom (light gray via alpha) background color. One block is on top of the other with some space in between them (via margin-top), and some padding around the divs on top/bottom:


<div style="background-color:rgba(0, 0, 0, 0.0470588); text-align:center; vertical-align: middle; padding:40px 0;">
<a href="/donate">DONATE</a>
</div>

<div style="background-color:rgba(0, 0, 0, 0.0470588); text-align:center; vertical-align: middle; padding:40px 0; margin-top:30px">
<a href="/blog">VIEW THE BLOG</a>
</div>

Edited by jpeskin

Share this post


Link to post
  • 4

The easiest way is to probably use a Markdown Block instead of a Text Block. Let’s say you have this written in a text block:
“And here’s to you, Mrs. Robinson, Jesus loves you more than you will know.”

Paste it into a Markdown Block and surround the part you want to “highlight” with span tags like this:


"And here's to you, <span style="background-color:green">Mrs. Robinson</span>, Jesus loves you more than you will know."

Edited by tazmeah

Share this post


Link to post
  • 0

Fantastic solution, thanks! I also see that divs can be inserted, with an example I listed in an answer here too.

Edited by jpeskin

Share this post


Link to post
  • 0

That works a treat! A couple of questions:

  • How do I create more than one line of text in my Markdown Block?
  • How can I change the colour and size of the font?

Thanks

Edited by rkay72

Share this post


Link to post
  • 0

@mcdent Seeing as this post is 2 years old, I would suggest opening a new question. Also try being a little more specific with what you are trying to accomplish and include a link to your site.

Share this post


Link to post
  • 0

Just to get clear, if you copy and past when @jpeksin wrote it won't work. The reason is that SquareSpace's MarkDown can't cope with more than three space characters at the start of each line.

i.e. This fails:

but this works:

DONATE

Cheers

J


I am new here. I am trying to develop a simple website on SquareSpace. So far I am finding it pretty darned frustrating.

Share this post


Link to post
  • 0
Posted (edited)

Hi @mrobinson99, I made a video tutorial for you on how to Change Background Color. Hope this helps! https://www.askquesty.com/post/change-background-color

Edited by AskQuesty
Initial Revision

Have Squarespace questions/task and need help today? **You can hire us here.** Our answers are on-demand, video recorded, and only cost between $5 to $25. Estimates are free, 100% satisfaction guarantee, and trusted by hundreds of small businesses.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment


×
×
  • Create New...