Jump to content

Replace Header Search Icon With Custom CSS

Recommended Posts

Hello
I want to replace the Squarespace search icon in the header with a custom png file that I've created - the default icons are not the same line weightas the shopping & account icons.
I've added a png file for the new icon into the custom css section but can't work out the code to overewrite the header  search form submit/input/input.
Any help would be appreciated.
Thanks,

Search Icon White.png

Link to comment
  • Replies 13
  • Views 609
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

On 5/2/2023 at 1:28 PM, Hicat said:

Add to Design > Custom CSS

.Header-search-form-submit svg {
    display: none !important;
}

.Header-search-form-input {
    display: block !important;
    background-size: contain !important;
    background-repeat: no-repeat;
    background-position: right;
    background-image: url(https://static1.squarespace.com/static/52c15df7e4b04b560cae0f98/t/644cfa8d4a93220062ea5afc/1682766477877/Search+Icon+White.png) !important
}

 

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

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment

Thanks but I've not made myself clear....I want just a search icon in the header that can be picked & takes you to a search form input page - no input placeholder. I've changed the design settings to Icon only as this was set to Rectangle.

Link to comment

Add to Last Line in Code Injection > Footer

<script>
  $(document).ready(function(){
    $('<img src="https://static1.squarespace.com/static/52c15df7e4b04b560cae0f98/t/644cfa8d4a93220062ea5afc/1682766477877/Search+Icon+White.png">').appendTo('.Header-search-form-submit');
});
</script>
<style>
  button.Header-search-form-submit svg {
    display: none !important;
}
  button.Header-search-form-submit img {
    width: 20px;
}
</style>

 

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

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment

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.