Jump to content

Highlighted Text CSS

Recommended Posts

Hi, I'm trying to highlight particular text lines with this code, below. It all works great apart from when I've added the code my text lines go left-justified rather than centered despite "text edit" showing center.

 

Any tips?

 

--

// Highlighted Text //

h2 {
  background-image: linear-gradient(to top, #fcd5ce 50%, transparent 50%);
  width: auto;
  display: inline;
  }
h3 {
  background-image: linear-gradient(to top, #ffe5d6 50%, transparent 50%);
  width: auto;
  display: inline;
  }
h4 {
  background-image: linear-gradient(to top, #f8edeb 50%, transparent 50%);
  width: auto;
  display: inline;\h2 {
  background-image: linear-gradient(to top, #fcd5ce 50%, transparent 50%);
  width: auto;
  display: inline;
  }
  }

Link to comment
  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Hi. If you use display inline

text-align: center won't work.

Can you share link to page where text on. We can take a look?

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

How to: Setup Password & Share url Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care

Link to comment
20 hours ago, tuanphan said:

Hi. If you use display inline

text-align: center won't work.

Can you share link to page where text on. We can take a look?

Hi, thank you for your answer!

What should I change in the code to have highlighted text that I can change around in the text editor in terms of alignment? 

I'm doing a private client project and don't really want to share it publicly 😬

Link to comment

Create an account or sign in to comment

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

×
×
  • 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.