Text Tool Tip

TextToolTip.gif

Add a pop-up description box when a visitor hovers over a linked word or sentence. Below you will find a super-simple tutorial that will guide you through the installation and setup of this plugin.


Step 1: Insert the CSS

Insert the following code into your Squarespace site's Custom CSS editor or the Individual Page Header CSS injection (more info below) - the values in bold can be changed to suit your branding and site design. 

Where colour values are added, you can use either of the following:

  • Valid colour name e.g. 'red' or 'yellow'

  • Hex value e.g. #FECB2F

  • RGB(a) value e.g. rgb (255,255,255) or rgba (255,255,255,0.8) - optional opacity value '0.8'

  • HSL(s) value (optional opacity values '0.8') e.g. hsl (0, 0%, 20%) or hsla (0, 0%, 20%, 0.8) - optional opacity value '0.8'

If you need help finding colours and building colour palettes - coolors.io is an awesome resource!

Where 'border' values are added, you can use either: 'dotted', 'dashed', 'solid' or 'double'. 

This is a dotted underline (dotted 1px #FECB2F) 
This is a dashed underline (dashed 1px #FECB2F) 
This is a solid underline (solid 1px #FECB2F) 
This is a double underline (double #FECB2F) *the double underline style need the '2px' removed

Copy & paste this code:

/* TEXT TOOL TIP CSS */

.sqs-block-markdown  span{
  border-bottom: dotted 1px #FECB2F;
  cursor: help;
}
.sqs-block-markdown span ttt{
  position: absolute;
  max-width: 200px;
  background-color: #000000;
  margin-left: 10px;
  padding: 15px 15px;
  color: #FFFFFF;
  border-radius: 3px;
  border: solid 1px #FECB2F;
  pointer-events: none;
  opacity: 0;
  -webkit-transition: all .3s ease-in-out !important;
  -moz-transition: all .3s ease-in-out !important;
  -o-transition: all .3s ease-in-out !important;
  transition: all .3s ease-in-out !important;
}
.sqs-block-markdown  span:hover ttt{
  opacity: 1 !important
}

@media all and (max-width: 1025px){
  .sqs-block-markdown span ttt{
    position: fixed !important;
    width: 100vw !important;
    height: auto !important;
    bottom: 0px !important;
    left: 0px !important;
    border-radius: 0px !important;
    max-width: none !important;
    margin: 0px;
  }
}

Site wide CSS Injection:

sitewide-1.png
sitewide-2.png
sitewide-3.png
sitewide-4.png
 

Individual Page Header CSS Injection:

If using this method, be sure to wrap your CSS in <style></style> tags as shown in image 4!

header-2.png
header-3.png
header-4.png
 

Step 2: Add a Markdown Block

Insert a Markdown Block and insert the following code where you want the Text Tool Tip(s) to appear. 

The text after <span> and before <ttt> will be the trigger text link and the text inside <ttt> and </ttt> will be the text that displays on hover.

Here's how to set up the Text tool Tip itself:

<span>TRIGGER TEXT GOES HERE<ttt>DESCRIPTION TEXT GOES HERE</ttt></span>

Here's an example of a Markdown block with the Text Tool Tip included within a body of text content:

 

Step 3: Apply, Save & Refresh! ⚡️

 

Need some help?

If you need help installing your plugin or you find that the code provided is not working - please feel free to contact us by clicking the link below.

Noughts & Ones