Jump to content

Trying to add hyperlink to text in a code block!

Recommended Posts

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!

Link to comment
  • Replies 4
  • Views 1.5k
  • Created
  • Last Reply
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 (Enable Pinch/Zoom on lightbox)
🗓️ Delivery Date Picker (Squarespace Date picker form field)
💫 Gallery block 7.1 workaround
🥳 Sparkplugin Customisations Browsers (Browse +100 Spark plugin customisations)
🥳 Elfsight Template Browsers (Browse +1000 Elfsight widget Templates)

If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you!

 

Link to comment

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!)

Link to comment
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!!!

Link to comment

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.