Jump to content

a:visited link does not work in a DIV inside a markdown block

Recommended Posts

Site URL: https://hyperboloid-potato-aefg.squarespace.com/

I'm using a markdown block so I can create a border around content on my site. I've achieved the border by creating a custom CSS class .boxinfo

Inside my markdown block, I created a div and put my content inside it. This worked well for creating the border, but I noticed that links just appear as regular text. So I added CSS for the links.

  • The CSS for a:link works
  • CSS for a:visited does not work most of the time
  • I've noticed that sometime, the CSS for a:visited DOES work. In the screenshot below, it works for one link, and not for the other. Very strange

Here's my CSS:

.boxinfo {
     border: .25em solid #1779B5;
  	 border-radius: 1em;
     padding: 10px;
}

.boxinfo a:link {
  text-decoration: underline;
  color: #0a4564;
}

.boxinfo a:visited {
  text-decoration: underline;
  color: green !important;
}

And here's a sample of the markdown:

<div class="boxinfo">
  <H3>Example header</H3>
  [General Information][1]<br>
  [new link][2]
</div>

[1]: /site-search
[2]: /for-patients

 

For some reason, the styling is working for the first link, but not the second link (in "Preview mode"). See screenshot 1. However, when viewing the site on an icognito window without being logged in, the styling does not work at all. See screenshot 2.

Does anyone have any tips for me?

Screen Shot 2021-03-18 at 3.12.45 PM.png

Screen Shot 2021-03-18 at 3.15.02 PM.png

Link to comment
  • Replies 2
  • Views 560
  • Created
  • Last Reply

Update: I've discovered that this seems to be a browser issue, not something with the CSS. After banging my head on this for too long, I finally tested on other browsers (I wish I had done this hours ago).

The problem seems to be isolated to Chrome on MacOS (I'm on version Version 89.0.4389.90). 

I've now successfully tested on the following (didn't check versions):

  • Chrome Windows 
  • Microsoft Edge
  • Safari
  • Firefox (MacOS)
  • Safari (iOS)
  • Chrom (iOS)
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.