Jump to content

[Share] Simple Secondary Navigation above Header

Recommended Posts

Posted

If you want to create a simple secondary navigation, like this.

image.png.ef0493d5dabcaed2a1491ffcd417cf34.png

You can follow these steps.

#1. Use this code to Code Injection > Footer.

You can replace text/url to your desired text/url

<nav class="navbar">
        <ul class="nav-links">
            <li><a href="https://www.google.com" target="_blank">Google</a></li>
            <li><a href="https://www.facebook.com" target="_blank">Facebook</a></li>
            <li><a href="https://www.linkedin.com" target="_blank">LinkedIn</a></li>
            <li><a href="https://www.wikipedia.org" target="_blank">Wikipedia</a></li>
            <li><a href="https://www.amazon.com" target="_blank">Amazon</a></li>
        </ul>
</nav>

image.png.6b2a8d3eff63d79496d28f16cbb598d8.png

#2. Use this code to Custom CSS box

header#header {
  pointer-events: initial;
}
.navbar {
    background-color: black; /* Black background */
    padding: 10px 0; /* Top and bottom padding */
    font-size: 16px;
    width: 100%;
    z-index: 9999;
  position: relative;
}
.nav-links {
    list-style-type: none; /* Remove bullet points */
    display: flex; /* Use flexbox */
    justify-content: center; /* Center align */
    padding: 0; /* Remove padding */
}
.nav-links li {
    margin: 0 15px; /* Spacing between links */
}
.nav-links a {
    color: white; /* White text */
    text-decoration: none; /* No underline */
    opacity: 1; /* Opacity */
    transition: opacity 0.3s; /* Transition effect */
}
.nav-links a:hover {
    opacity: 0.5; /* Change opacity on hover */
}
/* Responsive design for mobile */
@media (max-width: 767px) {
    .nav-links {
        flex-direction: row; /* Maintain horizontal layout */
        justify-content: space-around; /* Distribute items evenly */
    }
}

image.thumb.png.0c37a8879fa69d3f2996ead026ef9a80.png

#3. To change secondary navigation color + text color, change these values

image.thumb.png.79fc5744e701e8e85cb0d6df9593c661.png

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!)

  • Replies 1
  • Views 372
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Posted Images

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.