Jump to content

Trying to add hyperlink to text in a code block!

Recommended Posts

Posted

Site URL: https://graysonshakespeareinthepark.squarespace.com/

Hi friends! 

I've created a code block on my homepage and added in text. I highlighted the words, then adjusted the highlight to look like an underline instead.

I'd like to now hyperlink the words to their respective pages on the site, but I can't find any CSS that works!!! I'd appreciate any help that anyone is willing to give, as I'm a noob when it comes to custom CSS <3

My website can be seen here, and I'm using the Pacific template. The password is "verona".

Thanks!

  • Replies 4
  • Views 1.7k
  • Created
  • Last Reply
Posted
On 12/14/2020 at 6:25 AM, introverb said:

Site URL: https://graysonshakespeareinthepark.squarespace.com/

Hi friends! 

I've created a code block on my homepage and added in text. I highlighted the words, then adjusted the highlight to look like an underline instead.

I'd like to now hyperlink the words to their respective pages on the site, but I can't find any CSS that works!!! I'd appreciate any help that anyone is willing to give, as I'm a noob when it comes to custom CSS ❤️

My website can be seen here, and I'm using the Pacific template. The password is "verona".

Thanks!

You should place the link tag outside the span

<a target="Donate" href="#support-us"> 
  <span class="highlight"> Donate
  </span>
</a>

 

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Pinch/Zoom images, videos - PDFs Lightbox - ...) </>  🗓️ Delivery Date Picker (Date picker form field)
Gallery block 7.1 workaround </> 🤖 Ask me anything

Posted

I see you added a tag for Donate Link.

Repeat this for Audition, See our next show

Then add this code to Home > Design > Custom CSS to make a link work

/* Code Block link */
.code-block h1 a {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
}
.code-block h1 {
    position: relative;
}

 

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

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Posted
16 hours ago, bangank36 said:

You should place the link tag outside the span


<a target="Donate" href="#support-us"> 
  <span class="highlight"> Donate
  </span>
</a>

 

ahh, thank you so much!

Posted
16 hours ago, tuanphan said:

I see you added a tag for Donate Link.

Repeat this for Audition, See our next show

Then add this code to Home > Design > Custom CSS to make a link work


/* Code Block link */
.code-block h1 a {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
}
.code-block h1 {
    position: relative;
}

 

many thanks!!!

Archived

This topic is now archived and is 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.