Jump to content

how to properly include icons in the announcement bar CSS?

Go to solution Solved by tuanphan,

Recommended Posts

I've been trying to follow some tutorials on how to add images to the announcement bar so I can place a phone and mail icons however I found that the icons do not keep their size and when switching to the mobile view it becomes very small and places itself distant from the text; I've no experience at all with code 😅 this is what I have at the moment, any help would be amazing 🙂 Thank you!

https://www.narakury.com
ps: the password to enter the website is 123

Quote

.sqs-announcement-bar:before {
  content:"";
  background-image: url(https://static1.squarespace.com/static/649d26c0f9f0f25c9e456df9/t/64ad68f6216e96626c728b7e/1689086198121/tele.png);
  
  background-repeat: no-repeat;
   background-size: 100%100%!important;
  padding: 0.1vw;
  padding-inline: 0.1vw;
  float: left;
  margin-top: 0.3vw;
  margin-left: 2vw;
  width: 2vw;
  height: 2vw;
  
}
.sqs-announcement-bar-text {margin-right: 1vw;
height: 1.5vw
}

Edited by NaraKury
Missed website
Link to comment

Oh, after a while I gave up and resorted to copy paste the phone/mail emojis. 😅 what I was trying to achieve was using a custom image for the phone/mail however the image in question couldn't keep the size so it made the announcement bar to enlarge or the image would become very small were you could barely see it.

I added the phone Icon back into the announcement bar so you can see! thank you for looking into it! 🙂

image.thumb.png.b2a48aae7f152f01d6a49471959874d1.png

Link to comment
  • Solution

Add this code under to resize image on mobile

@media screen and (max-width:767px) {
.sqs-announcement-bar:before {
    width: 5vw !important;
    height: 5vw !important;
}
}

image.png.6ebeb235e1765efc214b31367583570b.png

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

How to: Setup Password & Share url Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care

Link to comment

Hi @Tuanphan

I am trying to add font awesome social icons to the announcement bar. I tried using the code from this post and adding the <i> code for font awesome inside the content:""; area but the html wasn't processed. What would be the best way to do this?

Link to site: www.centerforcommunication.com

Thanks!

Seth

Link to comment
On 7/19/2023 at 10:42 PM, sethhoffman said:

Hi @Tuanphan

I am trying to add font awesome social icons to the announcement bar. I tried using the code from this post and adding the <i> code for font awesome inside the content:""; area but the html wasn't processed. What would be the best way to do this?

Link to site: www.centerforcommunication.com

Thanks!

Seth

The site url doesn't work. Can you check it again?

Two ways to add FA icon

First is use i code on Markdown Block or Code Block. You can't use it in content: ""

Two is use FA Unicode code into content: "", something like this content: "\f073"; however you need to declare font-family. Each FA version will have a different font-family - To find Unicode code, click icon on FA website 

image.thumb.png.7d1c95a8b36ba7889e22af846e5ebf2d.png

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

How to: Setup Password & Share url Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care

Link to comment
  • 3 weeks later...

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.