Jump to content

How do I add an image into the navi header?

Go to solution Solved by tuanphan,

Recommended Posts

You can design them in an image, then use this code to Website Tools > Custom CSS. Replace Pixabay with your image url.

header#header:before {
    content: "";
    background-image: url(https://cdn.pixabay.com/photo/2024/08/05/21/19/lion-8947711_1280.jpg);
    background-size: contain;
    background-repeat: no-repeat;
    display: block;
    width: 60%;
    height: 50px;
    background-position: right;
    margin-left: auto;
}

 

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
On 8/17/2024 at 5:23 AM, tuanphan said:

You can design them in an image, then use this code to Website Tools > Custom CSS. Replace Pixabay with your image url.

header#header:before {
    content: "";
    background-image: url(https://cdn.pixabay.com/photo/2024/08/05/21/19/lion-8947711_1280.jpg);
    background-size: contain;
    background-repeat: no-repeat;
    display: block;
    width: 60%;
    height: 50px;
    background-position: right;
    margin-left: auto;
}

 

Cool - this adds one image. What if I need to add 3 in a horizontal row with links?

Thank you

Link to comment
On 8/19/2024 at 9:46 PM, MegaKen27 said:

Cool - this adds one image. What if I need to add 3 in a horizontal row with links?

Thank you

If images with links, you will need script code.

Is this your site? 

https://megasupplypro.com/

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
  • Solution
On 8/28/2024 at 1:44 AM, MegaKen27 said:

Yes. How do I get that script code?

First, use this code to Website Tools > Custom CSS

div.img-bar {
	display: none;
}

Next, use this code to Website Tools > Code Injection > Footer

<div class="img-bar">
  <a href="https://google.com"><img src="https://cdn.pixabay.com/photo/2023/10/10/15/37/motorcycle-8306765_1280.jpg" width="50px"/></a>
    <a href="https://amazon.com"><img src="https://cdn.pixabay.com/photo/2022/08/07/20/28/night-7371349_1280.jpg" width="50px"/></a>
   <a href="https://ebay.com"><img src="https://cdn.pixabay.com/photo/2023/09/05/20/37/owl-8235801_1280.jpg" width="50px"/></a>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<script>
  $(document).ready(function(){
    $('div.img-bar').insertBefore('div.header-inner');
});
</script>
<style>
header#header div.img-bar {
    display: flex !important;
    justify-content: flex-end;
}
div.img-bar a {
    margin-left: 5px;
    margin-right: 5px;
}
</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
6 hours ago, tuanphan said:

First, use this code to Website Tools > Custom CSS

div.img-bar {
	display: none;
}

Next, use this code to Website Tools > Code Injection > Footer

<div class="img-bar">
  <a href="https://google.com"><img src="https://cdn.pixabay.com/photo/2023/10/10/15/37/motorcycle-8306765_1280.jpg" width="50px"/></a>
    <a href="https://amazon.com"><img src="https://cdn.pixabay.com/photo/2022/08/07/20/28/night-7371349_1280.jpg" width="50px"/></a>
   <a href="https://ebay.com"><img src="https://cdn.pixabay.com/photo/2023/09/05/20/37/owl-8235801_1280.jpg" width="50px"/></a>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<script>
  $(document).ready(function(){
    $('div.img-bar').insertBefore('div.header-inner');
});
</script>
<style>
header#header div.img-bar {
    display: flex !important;
    justify-content: flex-end;
}
div.img-bar a {
    margin-left: 5px;
    margin-right: 5px;
}
</style>

 

Nice! Thank you!
 

Now how do I add text to the left of those and how do I squeeze the space between those and the navigation?

Screenshot 2024-08-30 at 11.55.36 AM.png

Link to comment

@tuanphan - would it be possible to make one of these images a link? I have a client who wants an extra button on her nav bar for her store and I was thinking I could use an image for that function. Either a button/image above Whoa Zone or one on the left side of the logo ( to balance out where the Woah Zone button is on the right)

Screenshot 2024-08-30 at 2.55.24 PM.png

Link to comment
On 8/30/2024 at 10:59 PM, MegaKen27 said:

Nice! Thank you!
 

Now how do I add text to the left of those and how do I squeeze the space between those and the navigation?

Screenshot 2024-08-30 at 11.55.36 AM.png

#1. Text

Edit this code

<div class="img-bar">
  <a href="https://google.com"><img src="https://cdn.pixabay.com/photo/2023/10/10/15/37/motorcycle-8306765_1280.jpg" width="50px"/></a>
    <a href="https://amazon.com"><img src="https://cdn.pixabay.com/photo/2022/08/07/20/28/night-7371349_1280.jpg" width="50px"/></a>
   <a href="https://ebay.com"><img src="https://cdn.pixabay.com/photo/2023/09/05/20/37/owl-8235801_1280.jpg" width="50px"/></a>
</div>

to this

<div class="img-bar">
  <h3>Our Partners:</h3>
  <a href="https://google.com"><img src="https://cdn.pixabay.com/photo/2023/10/10/15/37/motorcycle-8306765_1280.jpg" width="50px"/></a>
    <a href="https://amazon.com"><img src="https://cdn.pixabay.com/photo/2022/08/07/20/28/night-7371349_1280.jpg" width="50px"/></a>
   <a href="https://ebay.com"><img src="https://cdn.pixabay.com/photo/2023/09/05/20/37/owl-8235801_1280.jpg" width="50px"/></a>
</div>

#2. Use this to Website Tools > Custom CSS

.header-inner {
    padding-top: 5px !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
On 8/31/2024 at 2:52 AM, RAMPDigitalMedia said:

@tuanphan - would it be possible to make one of these images a link? I have a client who wants an extra button on her nav bar for her store and I was thinking I could use an image for that function. Either a button/image above Whoa Zone or one on the left side of the logo ( to balance out where the Woah Zone button is on the right)

Screenshot 2024-08-30 at 2.55.24 PM.png

Can you share site url? I can check easier

But I guess we can use script code to duplicate current button with new text/url

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
On 9/1/2024 at 7:02 AM, tuanphan said:

#1. Text

Edit this code

<div class="img-bar">
  <a href="https://google.com"><img src="https://cdn.pixabay.com/photo/2023/10/10/15/37/motorcycle-8306765_1280.jpg" width="50px"/></a>
    <a href="https://amazon.com"><img src="https://cdn.pixabay.com/photo/2022/08/07/20/28/night-7371349_1280.jpg" width="50px"/></a>
   <a href="https://ebay.com"><img src="https://cdn.pixabay.com/photo/2023/09/05/20/37/owl-8235801_1280.jpg" width="50px"/></a>
</div>

to this

<div class="img-bar">
  <h3>Our Partners:</h3>
  <a href="https://google.com"><img src="https://cdn.pixabay.com/photo/2023/10/10/15/37/motorcycle-8306765_1280.jpg" width="50px"/></a>
    <a href="https://amazon.com"><img src="https://cdn.pixabay.com/photo/2022/08/07/20/28/night-7371349_1280.jpg" width="50px"/></a>
   <a href="https://ebay.com"><img src="https://cdn.pixabay.com/photo/2023/09/05/20/37/owl-8235801_1280.jpg" width="50px"/></a>
</div>

#2. Use this to Website Tools > Custom CSS

.header-inner {
    padding-top: 5px !important;
}

 

Awesome thanks!

 

Link to comment
On 9/1/2024 at 7:02 AM, tuanphan said:

#1. Text

Edit this code

<div class="img-bar">
  <a href="https://google.com"><img src="https://cdn.pixabay.com/photo/2023/10/10/15/37/motorcycle-8306765_1280.jpg" width="50px"/></a>
    <a href="https://amazon.com"><img src="https://cdn.pixabay.com/photo/2022/08/07/20/28/night-7371349_1280.jpg" width="50px"/></a>
   <a href="https://ebay.com"><img src="https://cdn.pixabay.com/photo/2023/09/05/20/37/owl-8235801_1280.jpg" width="50px"/></a>
</div>

to this

<div class="img-bar">
  <h3>Our Partners:</h3>
  <a href="https://google.com"><img src="https://cdn.pixabay.com/photo/2023/10/10/15/37/motorcycle-8306765_1280.jpg" width="50px"/></a>
    <a href="https://amazon.com"><img src="https://cdn.pixabay.com/photo/2022/08/07/20/28/night-7371349_1280.jpg" width="50px"/></a>
   <a href="https://ebay.com"><img src="https://cdn.pixabay.com/photo/2023/09/05/20/37/owl-8235801_1280.jpg" width="50px"/></a>
</div>

#2. Use this to Website Tools > Custom CSS

.header-inner {
    padding-top: 5px !important;
}

 

Is there a way to make it fit on mobile? www.megasupplypro.com

Just squeezing it proportionally would work....

or if you know a better way would be great. Appreciate it

Screenshot_20240905-201709.jpg

Link to comment
On 9/7/2024 at 8:28 AM, MegaKen27 said:

Is there a way to make it fit on mobile? www.megasupplypro.com

Just squeezing it proportionally would work....

or if you know a better way would be great. Appreciate it

Screenshot_20240905-201709.jpg

Use this code to Website Tools > Custom CSS

@media screen and (max-width:767px) {
header#header div.img-bar img {
    width: 50px;
}
header#header div.img-bar a, header#header div.img-bar p {
    margin: 5px;
}
}

image.png.3a2510d44005da41637f19171af49123.png

or if you want to make them bigger, you can consider using 2 rows of logo (left me know, I will check & give extra code)

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
3 hours ago, tuanphan said:

Use this code to Website Tools > Custom CSS

@media screen and (max-width:767px) {
header#header div.img-bar img {
    width: 50px;
}
header#header div.img-bar a, header#header div.img-bar p {
    margin: 5px;
}
}

image.png.3a2510d44005da41637f19171af49123.png

or if you want to make them bigger, you can consider using 2 rows of logo (left me know, I will check & give extra code)

Yes please - 2 rows would make more sense. Appreciate your help.

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.