Jump to content

I added custom code to use an alternative logo for specific page headers, but I can't figure out how to modify the code to make the logo larger.

Go to solution Solved by Lesum,

Recommended Posts

I needed to use a different logo for a page of my website, so I added the following code into the page header code injection. I was able to get the alternative logo to appear but now it's too small. Adjusting the max-height doesn't seem to help, but it does help prevent the logo from repeating. What code can I add or adjust so that I can make the logo larger?

 

<style>

.header-title{
 background-image:url('image-url-here'); 
  background-repeat: no-repeat!important;
  max-height: 100px;
 background-size: contain

.header-title img{
opacity:0
}
</style>

Link to comment
  • Replies 8
  • Views 114
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

@MackenzieKuck If I understand correctly, you want to change the link for the header logo. You can add the following code to the page’s header code injection. Just replace the 'add-url-here' part with your URL. 

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>

<script>
$(document).ready(function() {
$('.header-title-logo a, .header-mobile-logo a').attr('href','add-url-here');
});
</script>

Also I noticed your header logo is not clickable. You need to modify this part of your existing code 

.header-title{
 background-image:url('image-url-here'); 
  background-repeat: no-repeat!important;
  max-height: 100px;
 background-size: contain
} 

to the following: 

.header-title a {
 background-image:url('image-url-here'); 
  background-repeat: no-repeat!important;
  max-height: 100px;
 background-size: contain
} 

 

If my comments were useful, please like or mark my solution as answer so others can scroll to it quickly. 

Sam
Web Developer & Digital Designer

 Did you find my contribution helpful? Buy me a coffee?

Link to comment
16 minutes ago, Lesum said:

If I understand correctly, you want to change the link for the header logo. You can add the following code to the page’s header code injection. Just replace the 'add-url-here' part with your URL. 

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>

<script>
$(document).ready(function() {
$('.header-title-logo a, .header-mobile-logo a').attr('href','add-url-here');
});
</script>

Thank you! Revising the code to make the logo clickable worked great. However, I am not sure if I entered the above code correctly. I made sure to revise the 'add-url-here' to be the url that I want to point the link to, and I entered this code below the existing code in the page header code injection, but it still links to the default home page. 

Edited by MackenzieKuck
Link to comment
  • Solution

@MackenzieKuck You just need to add the link inside a quote. So the code should look like this:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>

<script>
$(document).ready(function() {
$('.header-title-logo a, .header-mobile-logo a').attr('href','https://mackenziekuck.com/take-heart-textiles');
});
</script>

 

If my comments were useful, please like or mark my solution as answer so others can scroll to it quickly. 

Sam
Web Developer & Digital Designer

 Did you find my contribution helpful? Buy me a coffee?

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.