I am looking to expand my CSS/HTML menu with an additional sub-sub menu. What is the correct way to achieve this?

This is my current CSS code that I am working on. I am trying to create a multi-level menu in Blogger with submenus, sub-submenus, and sub-sub-submenus without disrupting the existing formatting.

.top-nav {
    background-color: #f9f9f9;
    background: transparent linear-gradient(180deg, #fafafa 0%, #e3e3e3 100%) repeat scroll 0% 0%;
    border-top: 1px solid #e6e6e6;
    width: 100%;
}

    .top-nav .Pagemenu {
    }

.Pagemenu {
    display: block;
}

    .Pagemenu li {
        display: inline-block;
        position: relative;
        z-index: 10;
        margin: 0;
    }

        .Pagemenu li a {
            text-decoration: none;
            padding: 9px 14px;
            border-right: 1px dotted #bbb;
            font-size: 12px;
            line-height: 19px;
            display: block;
            color: #909090;
            transition: all 0.2s ease-in-out 0s;
        }

            .Pagemenu li a:hover, .Pagemenu li:hover > a {
                background: #eee;
            }

.main-nav {
    background-color: #0FBE7C;
    background: transparent linear-gradient(180deg, #0FBE7C 0%, #0C9863 100%) repeat scroll 0 0;
    display: block;
    width: 100%;
}

.menu {
    display: block;
}

    .menu li {
        display: inline-block;
        position: relative;
        z-index: 10;
    }

        .menu li:first-child {
            margin-left: 0;
        }

        .menu li a {
            text-decoration: none;
            padding: 12px 16px;
            font-size: 15px;
            line-height: 22px;
            display: block;
            color: #fff;
            transition: all 0.2s ease-in-out 0s;
        }

...

I have encountered an issue when adding a sub-sub-submenu in HTML. It doesn't display properly on the webpage because it fails to show "all the child" elements. I tried modifying the HTML but couldn't figure out the corresponding CSS changes needed to make it work. Can someone provide assistance?

<nav>
    <ul class='menu'>
        // Navigation Menu Items Here

</nav>
<div class='clear' />

https://i.sstatic.net/rNXw5.png

Answer №1

I have integrated your sample and enhanced it with colors to signify the functionality and presence of various elements. To test it, navigate to Greentech -> Sub-menu2 -> Sub Sub-menu2.

To include sub-menus, you simply need to insert a ul before closing the parent li tag.

body{
  background-color:black;
}

li{
  background-color:red;
}
.top-nav {
    background-color: #f9f9f9;
... (CSS code continues)
<nav>
   <ul class='menu'>
       <li><a expr:href='data:blog.homepageUrl'>Home</a></li>

       <!-- Customizing Navigation Menu Here -->

       ... (HTML code continues) 
   
</nav>
<div class='clear' />

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

Ways to ensure CSS affects icon inside main element?

Struggling to match the background color of Material-UI icons with the rest of the list items on hover. The CSS is not applying to both the icon and text despite styling the overall class (className= "dd-content-item"). Any assistance would be greatly appr ...

putting a division element above a image carousel

Is there a way to overlay a div tag on top of a slideshow, similar to the one shown in this link? In the example provided, a div with the title "DISCOVER THE JOY OF COOKING" is positioned over a slideshow. Any tips on how I can achieve this effect? ...

Receiving an HTTP 405 Error? The Post method may function on one page but encounter issues on another (specifically with AJAX, Jquery, $.post

I'm facing a perplexing issue that has me puzzled. My website is currently hosted on IIS (in the testing phase, so everything is running through localhost). Using IIS 7.5 In my homepage (written in HTML), I have successfully implemented a PHP scrip ...

CrossBrowser - Obtain CSS color information

I'm attempting to retrieve the background color of an element: var bgcolor = $('.myclass').first().css('background-color') and then convert it to hex function rgbhex(color) { return "#" + $.map(color.match(/\b(\d+ ...

Unusual Behavior Uncovered in jQuery Selectors

Have you ever noticed a peculiar behavior of jQuery selectors? I recently discovered that when the page contains elements with non-unique IDs, jQuery returns different results for the same selectors: Here's an example of HTML code: <button id=&ap ...

What is the best way to make multiple HTML tables sortable?

I recently implemented an open-source JavaScript table sorter in my project. You can find more information about it here: However, I encountered an issue where only the most recently added table on my page is sortable. When users press a button, new table ...

Tips for aligning text to the right within a div using the "justify" text-align property

I want the final sentence of my content to be aligned to the right side while the rest remains justified. I attempted using a <span> within a <p> tag, but it did not work as expected: span.activity-conclusion { font:22px 'Open Sans ...

Unconventional arrangement of gaps for radio buttons

Hey there, I've been searching for solutions on various platforms but haven't found any luck so far. These are the questions I've looked into: Radio buttons and label to display in same line Documentation on <FIELDSE ...

Enhance Your Website with HTML5 Video Transition Effects

Is it possible to recreate video transition effects using HTML5 similar to the ones shown in this example: Can this be achieved across all major browsers, including Safari, Firefox, Chrome, and IE9? ...

Tips for preserving a string in angularJS or Java (and implementing it in an iframe)

My plan involves utilizing a Java web service to fetch the HTML content from a specific URL using Jsoup, and then returning it as a string to the requesting party, which could be an Angular or JS script. I am keen on preserving this content somewhere and l ...

Web-based client services

Context: An HTML file I'm working with takes in multiple parameters and utilizes JavaScript to dynamically render the content. The page pulls data from various local XML files for processing. For instance, accessing service.html?ID=123 displays info ...

Steps to hide a div after it has been displayed once during a user's session

After a successful login, I have a div that displays a success message and then hides after 4 seconds using the following JavaScript code: document.getElementById('success').style.display = 'none'; }, 4000); While this functionality wo ...

What is the best way to make a dropdown button on a top navigation bar show as active using Semantic-ui?

I searched through the Semantic-ui documentation, but I couldn't find clear instructions on how to designate a dropdown item as 'active' (highlighted without being opened) in my top navbar menu, similar to regular items. The 'active&ap ...

Tips on automatically populating a textbox without the need for a button click

I am currently using the following code: <input type="text" value="<?php echo empty($this->session->store['actual_info']['actual_total_marketing_budget']) ? '' : $this->session->store['actual_info' ...

Transmitting HTML and CSS code to the server for seamless conversion into a PDF file

I recently started using a tool called GemBoxDocument that allows me to convert HTML files into PDFs. Their website provides sample code demonstrating how to convert an existing file on a server (source): using System; using System.Linq; using System.Tex ...

Modifying an image's height and width attributes with jQuery and CSS on click action

I'm currently developing a basic gallery using HTML, CSS, and jQuery. The objective is to have a larger version of an image display in a frame with an overlay when the user clicks on it. While this works flawlessly for horizontally-oriented images, ve ...

Displaying HTML with extracted message form URL

I have a link that redirects to this page Is there a way for me to extract the message "Message Sent Successfully" from the URL and display it in the form below? <form action="send_form_email.php" name="contactForm" method="post"> //I want to d ...

Alter the td styling depending on the value using AngularJS

I need to dynamically change the style of each td in a column based on its value. There are five different statuses, so each status should have a unique border-color and font-color assigned to it. How can I achieve this using Angular script without hard-co ...

Block with vertical text covering entire height

I need to place an additional block with 100% height and vertical text (bottom-to-top direction) inside a variable height block, aligning it to the left side without using width and height calculations in JS. Is there a way to achieve this using CSS transf ...

Is there a way to rotate a div without utilizing the "transform" CSS property?

I am currently utilizing a plugin from the SVG library to render graphics within a div (). However, I am encountering an issue when attempting to rotate it using the "transform" property. The rotation is purely visual and does not alter the X and Y axes of ...