Design a logo to serve as the main button on the navigation bar of the

I've been experimenting with adding a logo instead of the 'Home' text in my navigation bar, but I'm not sure where to implement it. Should I add it within #nav or separately? Also, I want the nav bar to stay fixed without overlapping on other sections or disappearing on smaller screens. It might be too much to ask in one question.

Here's my HTML:

        <!-- Header -->
            <div id="header">

                <!-- Logo -->
                    <h1 hidden><a href="index.html" id="logo">Helios <em>Solutions</em></a></h1>


                    <nav id="nav">
                        <ul>
                            <li class="current" id="titlehome"><a href="index.html">Helios Solutions</a></li>
                            <li>
                                <a href="left-sidebar.html">Ons zorgaanbod</a>
                                <ul>
                                    <li><a href="#">Dienst 1</a></li>
                                    <li><a href="#">Dienst 2</a></li>
                                    <li><a href="#">Dienst 3</a></li>
                                    <li><a href="#">Cliënten aan het woord</a></li>
                                </ul>
                            </li>
                            <li>
                                <a href="left-sidebar.html">Over Helios Solutions</a>
                                <ul>
                                    <li><a href="#">Onze missie</a></li>
                                    <li><a href="#">Onze werkwijze</a></li>
                                    <li><a href="#">Ons team</a></li>
                                    <li><a href="#">Vacatures</a></li>
                                </ul>
                            </li>
                            <li>
                                <a href="left-sidebar.html">Voor cliënten</a>
                                <ul>
                                    <li><a href="#">Uw privacy</a></li>
                                    <li><a href="#">Uw klachten</a></li>
                                    <li><a href="#">Onze cliëntenraad</a></li>
                                </ul>
                            </li>
                            <li><a href="#contact" class="smoothScroll">Contact</a></li>
                            <li><a href="tel:+31505731019">050 573 10 19</a></li>
                        </ul>
                    </nav>
        </div>
    </div>

My CSS:

/* Header */

#header {
    padding: 0 0 0 0;
    background-color: #1176C0;
    background-image: url("images/bg02.png"), url("images/bg02.png"), url("images/bg01.png");
    background-position: top left,                  top left,                   top left;
    background-size:     0% 0,                      0% 0,                       auto;
    background-repeat: no-repeat,                   no-repeat,                  repeat;
}

    #header h1 {
        padding: 0 0 0 0;
        margin: 0;
    }

        #header h1 a {
            font-size: 1.5em;
            letter-spacing: -0.025em;
            border: 0;
        }

/* Nav */

    #nav {
    cursor: default;
    background-color: #1176C0;
    background-image: -moz-linear-gradient(top, rgba(0,0,0,0), rgba(0,0,0,0.3)), url("images/bg01.png");
    background-image: -webkit-linear-gradient(top, rgba(0,0,0,0), rgba(0,0,0,0.3)), url("images/bg01.png");
    background-image: -ms-linear-gradient(top, rgba(0,0,0,0), rgba(0,0,0,0.3)), url("images/bg01.png");
    background-image: linear-gradient(top, rgba(0,0,0,0), rgba(0,0,0,0.3)), url("images/bg01.png");
    padding: 0;
}

    #nav:after {
        content: '';
        display: block;
        width: 100%;
        height: 0.6em;
        background-color: #fff;
    }

    #nav > ul {
        margin: 0;
        font-weight: bold;
    }

        #nav > ul > li {
            position: relative;
            display: inline-block;
            margin-left: 1em;
        }

            #nav > ul > li a {
                color: #fff;
                text-decoration: none;
                border: 0;
                display: block;
                padding: 1.5em 0.5em 1.35em 0.5em;
            }

            #nav > ul > li:first-child {
                margin-left: 0;
            }

            #nav > ul > li:hover a {
                color: #F09200;
                font-weight: 600;
            }

            #nav > ul > li.current {
            }


                #nav > ul > li.current:before {
                    -moz-transform: rotateZ(45deg);
                    -webkit-transform: rotateZ(45deg);
                    -ms-transform: rotateZ(45deg);
                    transform: rotateZ(45deg);
                    width: 0.6em;
                    height: 0.6em;
                    content: '';
                    display: block;
                    position: absolute;
                    bottom: -0.4em;
                    left: 50%;
                    margin-left: -0.375em;
                    background-color: #fff;
                }

                #nav > ul > li.current a {
                    color: #fff;
                }

            #nav > ul > li.active a {
                color: #fff;
            }

            #nav > ul > li.active.current:before {
                opacity: 0;
            }

            #nav > ul > li > ul {
                display: none;
            }

My JS:

(function($) {

skel.breakpoints({
    wide: '(max-width: 1680px)',
    normal: '(max-width: 1280px)',
    narrow: '(max-width: 980px)',
    narrower: '(max-width: 840px)',
    mobile: '(max-width: 736px)',
    mobilep: '(max-width: 480px)'
});

$(function() {

    var $window = $(window),
        $body = $('body');

    // Disable animations/transitions until the page has loaded.
        $body.addClass('is-loading');

        $window.on('load', function() {
            $body.removeClass('is-loading');
        });

    // Fix: Placeholder polyfill.
        $('form').placeholder();

    // Prioritize "important" elements on narrower.
        skel.on('+narrower -narrower', function() {
            $.prioritize(
                '.important\\28 narrower\\29',
                skel.breakpoint('narrower').active
            );
        });

    // Dropdowns.
        $('#nav > ul').dropotron({
            offsetY: -15,
            hoverDelay: 0,
            alignment: 'center'
        });

    // Off-Canvas Navigation.

        // Title Bar.
            $(
                '<div id="titleBar">' +
                    '<a href="#navPanel" class="toggle"></a>' +
                    '<span class="title">' + $('#logo').html() + '</span>' +
                '</div>'
            )
                .appendTo($body);

        // Navigation Panel.
            $(
                '<div id="navPanel">' +
                    '<nav>' +
                        $('#nav').navList() +
                    '</nav>' +
                '</div>'
            )
                .appendTo($body)
                .panel({
                    delay: 500,
                    hideOnClick: true,
                    hideOnSwipe: true,
                    resetScroll: true,
                    resetForms: true,
                    side: 'left',
                    target: $body,
                    visibleClass: 'navPanel-visible'
                });

        // Fix: Remove navPanel transitions on WP<10 (poor/buggy performance).
            if (skel.vars.os == 'wp' && skel.vars.osVersion < 10)
                $('#titleBar, #navPanel, #page-wrapper')
                    .css('transition', 'none');

});

})(jQuery);

Answer №1

Add the line below either right after your navigation starting tag or just before the navigation ending tag, depending on whether you want the logo to appear on the left or right side of your navbar.

<a class="navbar-brand" href="path-to-root"><img src="path-to-logo"></a>

By following these steps, you should see your logo displayed on your navbar. I hope this explanation proves helpful.

(Note: "navbar-brand" is a Bootstrap class, but if you're not using Bootstrap, feel free to use this class to customize the styling of the logo in your own CSS).

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Make the AJAX response a global variable

I'm currently experimenting with Google's APIs using AJAX through the jQuery library. To access a Google service API, I need to obtain an auth token by sending a request to ClientLogin. However, I am unsure of how to pass this token to the second ...

How can I insert my JavaScript functions into the JSF event queue for processing?

Is there a way to tap into the default JSF ajax(JS) event queuing system in order to execute events sequentially? I am attempting to align my JS events with this queue. Is there a global variable that can facilitate this synchronization? ...

Instructions on incorporating domains into next.config.js for the "next/image" function with the help of a plugin

Here is the configuration I am currently using. // next.config.js const withImages = require("next-images"); module.exports = withImages({ webpack(config, options) { return config; }, }); I need to include this code in order to allow images from ...

Creating Json for jsTree can be done by following these steps

Yesterday, I stumbled upon the versatile jsTree plugin and was really impressed. Does anyone happen to have a SQL sample that creates JSON data for it? ...

Show the information in an array that corresponds to the selected option in a dropdown menu

I have an array with country data and I want to display specific information based on a selected option from a dropdown menu. The 'making_calls' value should be displayed in the .price-call paragraph, and the 'sending_texts' value in t ...

A possible substitute for the "background-size" CSS attribute

After struggling for days without success, I find myself once again seeking your help. The current issue revolves around the slideshow on THIS website, which is powered by the jQuery Infinite Carousel Plugin. Despite adding background-size: auto 100%; to ...

Dividing a JSON array by a specific key using lodash underscore

I'm on a quest to extract the distinct items in every column of a JSON array. Here is what I aim to convert : var items = [ {"name": "Type 1","id": 13}, {"name": "Type 2","id": 14}, {"name": "Type 3","id": 14}, {"name": "Type 3","id": 13}, {"na ...

Passing parent HTML attributes to child components in Angular 2

Is there a way to pass HTML attributes directly from parent to child without creating variables in the parent's .ts class first? In the sample code below, I am trying to pass the "type=number" attribute from the parent to the app-field-label component ...

Tips for Customizing the Appearance of Material UI Select Popups

My React select component is functioning properly, but I am struggling to apply different background colors and fonts to the select options. https://i.stack.imgur.com/kAJDe.png Select Code <TextField fullWidth select size="small" nam ...

When working with an outdated package, you may encounter a situation where babelHelpers is not

My current focus is on a vuetify v1.5 project. Unfortunately, one of the dependency packages (d3-flextree) is causing an issue with the 'babelHelpers is not defined' error. The solution I came across suggests using transform-runtime instead of th ...

export module from the express framework

function affirm(){ console.log("yes") } Element={} Element=affirm Element.something="something" Element.nothing="nothing" DEPICTED IN WEB BROWSER: In the code snippet above, if you were to console.log(Element), it would display ...

Customizing Your WordPress Menu with HTML5 Features

Can someone assist me in creating a customized WordPress menu? I am facing issues with unnecessary classes added by WordPress and the lack of certain attributes on dropdowns. Below is the HTML code: <nav class="navbar navbar-default navbar-static- ...

JavaScript capable of storing vast quantities of data

Currently, I am receiving file chunks in byte format from my server and combining them into one variable on my frontend for downloading later. Unfortunately, I am unable to modify the server setup which sends files sliced into chunks. The issue arises whe ...

What is the equivalent of defining conditional string types in Typescript similar to flow?

type UpsertMode = | 'add' | 'update' | 'delete'; interface IUpsertMembers { mode: UpsertMode; } const MagicButton = ({ mode: UpsertMode }) => { return ( <button>{UpsertMode}</button> ); } const Upse ...

The cloud function in Firebase was unable to connect to the dialogflow route

I am currently working on creating a chatbot using Dialogflow integrated with OpenAI in Firebase Cloud Function. However, I am facing an issue where I cannot access the /dialogflow endpoint and keep receiving the error message: "Cannot GET /dialogflow". My ...

Tips for spinning HTML5 Canvas's background image and adjusting the zoom with a slider

As someone who is new to the world of coding, I have a few goals in mind: First and foremost, I want to create a canvas. I also aim to add a background image to the canvas. Importantly, this background image should be separate from any foreground images ...

I'm finding it difficult to understand the reasoning behind the custom hook I created

Looking at the code, my intention is to only execute one of these API requests based on whether origCompId is passed or not. If origCompId is passed as a query parameter, then duplicateInstance should run; otherwise, addNewInstance should be executed. The ...

Having trouble with MUI auto import suggestions in my Next.js 13 project on VS Code

I'm currently developing a project using Next.js 13 and have installed MUI. However, I am encountering an issue where VS Code is not providing auto imports from the @mui/material library, as shown in the attached screenshot. https://i.stack.imgur.com ...

Newly designed Bootstrap 4 input field with search feature positioned off-center on smaller screens

I have successfully positioned an input text next to a button as shown below: While it displays perfectly on a regular computer screen, the alignment gets skewed when viewed on a phone device: This is the functional code I am using: <!-- Add Filer Fo ...

Issue: subscribe function is not definedDescription: There seems to be an

I'm currently trying to retrieve a value from an array based on a specific element, and then finding the exact matching element. Unfortunately, I've encountered an error with this.getProduct(name1: string) function even though I have already impo ...