Skip to content

Commit

Permalink
fix footer icons
Browse files Browse the repository at this point in the history
  • Loading branch information
SamMed05 committed Nov 2, 2023
1 parent a435eef commit 707f11a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions useful-links.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ permalink: /useful-links/

// modified from https://css-tricks.com/favicons-next-to-external-links/
document.addEventListener("DOMContentLoaded", function() {
// select all links (<a> elements) that start with "http" (external links)
document.querySelectorAll("a[href^='http']").forEach(function(link) {
// select all links (<a> elements) that start with "http" (external links), but only inside main
document.querySelectorAll("main a[href^='http']").forEach(function(link) {
var icon = document.createElement("span");
icon.style.background = "url(https://www.google.com/s2/favicons?domain=" + link.hostname + ") left center no-repeat";
icon.style.paddingLeft = "20px";
Expand Down

0 comments on commit 707f11a

Please sign in to comment.