Jump to content

How can I add an external hyperlink to text in a code block?

Recommended Posts

Site URL: https://www.birchandbuddesign.com

I just added a marquee style text via css and a code block.  I want to add an external link to flodesk to text. 

This is the code in the text block. It is located within its own index page so nothing else to click on. 

<div class="scroll"> we're celebrating with launch promos...join the newsletter for the scoop!</div>

 

How would i go about doing that? *ideally* there is no underline link text or I can just click on the index page and the entire banner will link through. 

site: www.birchandbuddesign.com, password: design

 

 

Thanks!

Edited by lara_e
Link to comment

Hello, @lara_e. I don't fully understand your question, but together I'm sure we can work it out. I'll first assume that you're trying to add a text link to the code you have above. If you have access to edit this code
 

Quote

<div class="scroll"> we're celebrating with launch promos...join the newsletter for the scoop!</div>

Then we just need to add more code to it. Let's say you want to make the word "newsletter" a link. You'll need to wrap it in <a> tags, like so:

<div class="scroll"> we're celebrating with launch promos...join the <a href="https://www.google.com">newsletter</a> for the scoop!</div>

You can choose a different word or words. Notice the link I created goes to Google. You will also need to change that too.

A note of caution: with the code above, your link will not appear any differently than the text surrounding it. 

If you want all of the text to be a link,

<div class="scroll"><a href="https://www.google.com"> we're celebrating with launch promos...join the newsletter for the scoop!</a></div>
Edited by tazmeah
added another example
Link to comment
13 hours ago, tazmeah said:

<div class="scroll"><a href="https://www.google.com"> we're celebrating with launch promos...join the newsletter for the scoop!</a></div>

This is exactly what I wanted, thanks so much!! It was either that or make an index banner clickable, which seems difficult.

One last thing - is there an anything we can add to make the link open in a new tab? Im sending them to an external flodesk link.

Link to comment
26 minutes ago, tazmeah said:

If you want it to open in a new tab, we just add the "target" attribute, like so


<div class="scroll"><a href="https://www.google.com" target="_blank"> we're celebrating with launch promos...join the newsletter for the scoop!</a></div>

For reference on "target" attributes, please see this link. https://www.w3schools.com/tags/att_a_target.asp

Thank you so much! That worked, super helpful thanks for your time!

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.