Tips for creating a vertical navigation submenu with hover using Bootstrap style

How can I create a vertical navigation with sub-menu/widgets using Bootstrap 4.2.1?

Here is the requirement:

https://i.sstatic.net/JaiLV.jpg

My attempt so far: The menu only works onclick, not on mouse over (sub menu still shows when mouse moves out).

HTML:

<ul class="navbar-nav">
            <li class="nav-item">
                <a class="nav-link" href="#page-hero">
                    <i class="fa fa-circle" aria-hidden="true"></i>MyIB
                </a>
            </li>
            <li class="nav-item dropdown-submenu">
                <a class="nav-link" href="#page-hero" data-toggle="collapse" data-target="#submenu1">
                    <i class="fa fa-circle" aria-hidden="true"></i>Store
                    <i class="fa fa-caret-right" aria-hidden="true"></i>
                </a>
                <div class="menu-items " >

                    <div class="menu-point">
                        <div class="menu-wrapper collapse" id="submenu1">
                            <h3>Title goes here</h3>
                            <div class="nested-menu">
                                <div class="sub-menu" >
                                  <a class="dropdown-item" href="#">French</a>
                                  <a class="dropdown-item" href="#">German</a>
                                  <a class="dropdown-item" href="#">Doutch</a>
                                </div>
                                <div class="sub-menu" >
                                  <a class="dropdown-item" href="#">French</a>
                                  <a class="dropdown-item" href="#">German</a>
                                  <a class="dropdown-item" href="#">Doutch</a>
                                </div>
                                <div class="sub-menu" >
                                  <a class="dropdown-item" href="#">French</a>
                                  <a class="dropdown-item" href="#">German</a>
                                  <a class="dropdown-item" href="#">Doutch</a>
                                </div>
                            </div>  
                        </div>  
                    </div>

                </div>
            </li>
       </ul>

Answer №1

Feel free to experiment with the following CSS snippet:

.dropdown:hover>.dropdown-menu {
  display: block;
}
.dropdown>.dropdown-toggle:active {
    pointer-events: none;
}

You can view a working example on this CodePen link.

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

Is there a way to target a button within an anchor tag without relying on a specific id attribute?

On my webpage, I have buttons that are generated dynamically using PHP from a MySQL table. Each button is wrapped in an anchor tag and when clicked, it triggers a Javascript function to carry out multiple tasks. One of these tasks requires extracting the ...

Tips for creating a radio button that appears consistent across Firefox, Chrome, and IE11

I am looking to create a set of Radio buttons that will display consistently across Chrome, Firefox, and IE 11. My current solution appears to work well in Firefox, but in Chrome, there is a blue box around the buttons, and in IE 11, it seems that the colo ...

I'm attempting to showcase an HTML file by using res.sendFile within the Express framework

As part of my workflow implementation, I have set up a scenario where upon user login, the credentials are sent via Ajax to an Express route for verification. If the user exists, the route responds with a message "authorised" triggering a second Ajax call ...

What is the best way to use the cursor-pointer property in combination with a (click) event handler

<i class="cursor-pointer" (click)="sort()"></i> Our development team is grappling with numerous repetitive class definitions such as this one. I wanted to find a more efficient way to automatically add the cursor pointer style whenever a (clic ...

When rotating, the SVG ellipses move towards the upper left corner

Why does my animated lp end up in the top left corner instead of centering? I've tried using transform-origin: center; but it's not working. Any help would be greatly appreciated. Thank you in advance. #Component_6_2{ -webkit-transform-orig ...

Interactive Canvas Feature: Drag and Drop Across Various Objects in HTML 5

I have developed a custom code that enables the creation and rendering of objects on an HTML5 canvas. class Rectangle extends Shape { constructor(options, canvas, type = 'rectangle') { super(...); // inherited from the super class thi ...

The Chrome Elements console fails to display a specific element when provided with an xPath

When I press F12, navigate to Elements, and then click ctrl+F to search for an xPath. If only one element is found, it is not highlighted (although Chrome will indicate 1 of 1). However, if multiple elements are found, Chrome highlights from the second one ...

Deactivate the button until the input meets validation criteria using Angular

What I'm trying to achieve is to restrict certain input fields to only accept integer or decimal values. Here's the code snippet that I currently have: <input type="text" pattern="[0-9]*" [(ngModel)]="myValue" pInputText class="medium-field" ...

iOS fixed positioning and scrolling

One of the current challenges we are facing involves implementing an action button similar to the one found in GMail for adding new content. This button needs to remain fixed during scroll. Here is the HTML code: <div class="addButton actionButton" on ...

I envision my home page being divided into two visually stunning full-screen sections, each taking up the entire height of the page

I am currently working with the code shown below. It successfully displays the first part in full height, regardless of resolution, but once I scroll to the second half, there is a large empty gap. How can I eliminate this gap and make the transition smoot ...

It is not possible to modify the CSS styles within the PrimeFaces Ultima template

Within my JSF project, I am utilizing the ultima template's latest version (ver. 2.0.2). Following the recent update of the project, there seems to have been a change in the CSS due to the presence of this selector: * { -moz-box-sizing: border-box ...

Creating a split-view menu in WinJS: A step-by-step guide

I'm attempting to create a versatile app using JavaScript. I followed a tutorial on the MSDN website, but for some reason, the "nav-commands" class isn't displaying when the splitview is opened. I have set closedDisplayMode = 'none'. & ...

The functionality of the localStorage HTML5 feature is experiencing issues within the WebView on Samsung Android devices

I am currently facing an issue with my HTML5 application which I am wrapping with a WebView. In order to store and retrieve user input values between pages, I have been utilizing the localStorage feature in HTML5. Interestingly, this feature functions per ...

Is there a way to capture and print an entire DOM element with the help of angular-screenshot?

I attempted to use the example code from this webpage: The challenge I faced was that they utilize an entire controller for it, whereas I have my controllers separated by views. Here is how I integrate them into my "main" js: .state("main.pallet", { ...

Table within a fieldset and legend that scrolls

I am experiencing an issue with a table that is nested in a fieldset. The problem arises when the height of the table exceeds the height of the fieldset, causing a left scrollbar to appear. However, the <legend> element scrolls along with the table i ...

Designing stylesheets for larger screens to optimize the layout

I am currently working on the front-end design of a website and could use some assistance regarding element sizing. While the layout and elements look great on my 19-inch, 1440x900 resolution monitor, I noticed that everything appears tiny when viewed on a ...

I am experiencing an issue with the initial for-loop in my code as it is not

Upon clicking the start button, the score button, as well as the try again or correct button, are not being updated. Can someone help me figure out what's wrong? I believe the issue lies within this section of the code: for (i=0; i<5; i++) { do ...

Eliminating the vertical scroll on a webpage with the help of Bootstrap 5's responsive design capabilities

I've been tasked with converting a Figma design into an HTML page using Bootstrap 5. Take a look at the Figma design: https://i.sstatic.net/jo5Si.png However, there's an issue causing a vertical scroll bar to appear on the page. The culprit see ...

The issue of HTML Service Submit Form not triggering the google.script.run function

Everything was going smoothly with my script until it suddenly stopped functioning properly. A user selects an option from a custom menu, triggering a dialog box (HTML Service form) to collect two parameters as intended. Upon submitting the form, the fol ...

What is the best way to determine if a PHP string has identical consecutive letters?

Can you help me figure out why my code isn't working? $pattern_c_sap='/\.\-/'; $local='.................'; $local_array = explode( '', $local ); for($i=0; $i<=$local_length; $i++){ if(preg_match($pattern_c_ ...