Jump to content

Open Specific Social Link in Same Tab via CSS

Recommended Posts

Posted (edited)

Hi, I'm trying to link to my contact page via a social icon [envelope]. I managed to swap out the URL icon for an envelope via CSS, but I want that link to open in the same tab. It currently opens in a new one.

Is this possible to do via CSS and something like "target=_self"? I only have a personal plan so cannot inject code.

Also, is it possible to swap that icon for the default Squarespace email icon instead of the one I'm using from icons8?

Site is http://theanalogworkshop.com

Thank you in advance for any assistance.

Edited by jviator11
Link to comment
  • Replies 1
  • Views 963
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

#1. Edit Footer > Add a Block > Choose Markdown > paste this code

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<script>
  jQuery(document).ready(function($){
  $('header#header a.icon').attr('target','_self');
})
</script>

#2. If you share link to page where you I can see Squarespace default email icon, I can help this easier.

or you can consider choosing icon here, I can give code

https://fontawesome.com/search?q=evelope&o=r&m=free

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

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.