Beatriz Caraballo

View Original

Add custom social icons to your Squarespace header (Brine 7.0)

If you’re doing a custom design, you may be wanting to go all in with things like colors, fonts, patterns and icons.

So, if you want to include those gorgeous social media icons you – or your graphic designer –created, keep reading my friend because we’ll be looking at how you can add custom social media icons to your Squarespace header!

See this content in the original post

The bad news is that to add custom icons to your navbar we’ll have to use HTML.

The good news is that it’s fairly easy! So let’s get to it.

First, go to Settings > Advanced > Code Injection to add the new icons bar to the top of every page of your site.

We’ll be creating a simple container that will act as the background of our social media bar. I’ll give it an ID of #socialicons-bar.

See this content in the original post

Next, we’ll be creating another container inside it. This will be the wrapper holding all of our icons and I’ll give it an ID of #socialicons.

By having this inside the previous container, it will be super easy for us to realign the icons!

See this content in the original post

Inside that last wrapper we’ll be adding a tags so that anything we place inside them (text or images) is clickable.

I’ll be adding 4 links, but you can use less or more depending on how many social icons you’re planning to add.

See this content in the original post

Great. Now, we can give each link its corresponding hyperlink.

I’m going to be working with Twitter, Facebook, Pinterest and Flicker (‘cause why not?) in that order.

See this content in the original post

Then, if you’re working with pure text you can simply type it in between each set of a tags, however since I want to add custom social icons I’ll be adding images.

Therefore, I need an img tag in between each of my link tags.

Each img tag will have a src and alt attribute so I can fill in the information for each social icon.

See this content in the original post

As you can see, FINALLY things are happening on our site.

We now have those broken link icon thingies along with the alt text we gave each image at the top of our screen.

Time to add the icons!

To do this, we need to either link to our images saved in an image hosting website, or simply upload them to our site through the CSS window and grab the link from there.

Just click on the “Manage Custom Files“ button at the bottom of your Custom CSS window, upload each of your icons and then click on the file to bring up their corresponding URL inside the window.

Once you have all your links, I recommend pasting them on a post it note on your desktop or a word document so its easier to copy/paste instead of having to go back to this window each time.

Don’t forget to DELETE the URL’s from the CSS window!!

Heading back to our HTML inside the Code Injection section, paste each of the image links inside its corresponding src attribute.

See this content in the original post

Alright! Our images are finally in place!!

Huge, but in place.

See this content in the original post

It’s time to move onto our Custom CSS window to style the bar a little bit.

I’ll begin by giving our new bar a background color, so I’ll be targeting the main container #socialicons-bar

See this content in the original post

And now how about we realign the icons to the right?

We can use text-align for that.

See this content in the original post

We can space them out a bit, so let’s set each a element as inline-block to give them a margin.

See this content in the original post

And let’s push all the icons further from the right edge by giving the #socialicons container a margin as well.

See this content in the original post

Last but not least, let’s shrink down the images!

We’ll target the img element inside our #socialicons container. I’ll give them a width of 27px.

See this content in the original post

Gorgeous!!

And btw, if you want to have the links open in a new tab, you can always go back into your HTML and add target=”_blank” to each of your a tags!

See this content in the original post

Here’s the final result in all three screen sizes!

So there you go, that’s how you can add custom social icons to your Squarespace site!

Until next time,

B.


See this content in the original post