Navigational menu aligned vertically alongside a horizontal subheading

I am in need of assistance with my website's navigation. I am looking to implement a horizontal navigation bar that, when hovered over, will reveal a dropdown sub-navigation with various sections (left and right alignment). Each section will have two horizontal headings with vertical sub-navigation links underneath. It may be a bit challenging for me to explain clearly, so please refer to the attached image for a visual representation.

(Unfortunately, I do not have enough reputation to directly upload an image on this platform.)

When hovering over "Heading 1," it should display two horizontal subheadings (Sub Head 1 & 2).

Beneath Subhead1 & 2 will be clickable vertical links that direct users to different pages.

(I forgot to include the link to the demo site). http://jsfiddle.net/8La4k57q/

 <nav id="nav" role="navigation">
<ul>
    <li>
        <a href="#" aria-haspopup="true">Heading 1</a>
        <ul>
        <a href="#" aria-haspopup="true">Sub Heading 1</a>
            <li><a href="#">Nav1</a></li>
            <li><a href="#">Nav2</a></li>
            <li><a href="#">Nav3</a></li>
            <li><a href="#">Nav4</a></li>

        <a href="#" aria-haspopup="true">Sub Heading 2</a>
            <li><a href="#">Nav5</a></li>
            <li><a href="#">Nav6</a></li>
            <li><a href="#">Nav7</a></li>
        </ul>
    </li>
</ul>

#nav > a
{
    display: none;
}
#nav li
{
    position: relative;
}



#nav > ul
{
    height: 3.75em;
}
    #nav > ul > li
    {
        width: 25%;
        height: 100%;
        float: left;
    }



#nav li ul
{
    display: none;
    position: absolute;
    top: 100%;
}
    #nav li:hover ul
    {
        display: block;
    }

Thank you

Answer №1

Let's delve into heading 1, where the id "heading1" will be used for the div containing the heading and "content" for the div holding the content.

$(document).ready(function(){
$("#heading1").mouseover(function(){
$("#content1").stop().slideDown();
});
$("#heading1").mouseout(function(){
$("#content1").slideUp();
});
});

The referenced content includes subheadings and links enclosed in a div named content1. To provide clearer guidance, sharing your HTML code would greatly assist in further explanation.

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

Setting the opacity of an image will also make the absolute div transparent

I currently have an image gallery set up with the following structure : <div class="gallery"> <div class="message"> Welcome to the gallery </div> <img src="http://placehold.it/300x300" /> </div> Here ...

I am looking to loop through an array nested within a JSON object and display it in a table column using

Within my JSON data, there is an array that I need to loop through in <td> tags. The functionality I am working on involves creating a table based on user input. The user specifies the number of rows, input columns, and output columns. I have three a ...

In Chrome, the height of 100% is not functioning properly within the <div> element

I've been struggling with a problem that I've searched the internet for solutions to, but haven't been able to resolve. The issue revolves around an iframe containing a page that loads specific CSS rules. html, body { position: relative; he ...

Align the number of an Unordered List to the left

Exploring UN-ordered lists in HTML has led me to wonder if it's possible for dynamically generated ul tags to display like this: * Hello * Hi * Bi * Name * Ron * Mat * Cloth * Color * Red When I ...

How to make a div expand to full width using CSS animations

Issue with Div Animation I am currently facing an issue where I am trying to animate a div to expand to 100% of its child's width on hover. However, the animation is not working smoothly as expected. Instead of gradually expanding to the right, the d ...

Direct users according to their browser language (excluding php)

My site is going to have content in 3 languages, with French set as the default (fr). Here's how the structure of the website looks: Root directory (important note: no php files, just plain html) /fr/ Index.html About-us.html Contact.htm ...

What are the advantages of storing data in HTML tags that do not contain any content?

Is it considered poor practice to include an empty span in a template, or is there a more effective solution available? Is it acceptable to use a blank span tag like this within my code? <span class="stored-id-number" data-idnumber="1234"><!-- em ...

Why won't my Nivo Slider images print? How can I make my Nivo Slider images appear on printouts?

I am having trouble printing the nivo slider (default-theme): Despite trying for a few days, I still can't figure out why it's not working. I have attempted solutions like #slider { visibility: visible; width: 950px; height: 35 ...

Incorporate a Bootstrap panel featuring a stylish border design and perfectly centered text

I am attempting to design two panels in Bootstrap with centered text and different fonts. Similar to the layout shown in the image below https://i.sstatic.net/aVGwV.png Here is my code: <div class="row"> <div class="col-lg-6&q ...

Using JQuery to monitor the loading of a newly selected image src attribute

As a newcomer to JavaScript and JQuery, I am facing a challenge that I couldn't find a solution for in other discussions: I have a function that retrieves the path to an image (/API/currentImage) using a GET request and needs to update the src attrib ...

Develop a back button for PHP data fetched from a database

I have recently developed a quiz exam website where users can answer questions retrieved from a database. The structure of the website includes HTML and AJAX to call PHP functions for handling the questions. Each question is displayed one at a time to the ...

Spacing among values returned from the database

Seeking assistance with an issue in my code. I have written a piece of code that displays two columns from a database within a form. Unfortunately, the code is not allowing me to separate the two columns properly in the form. For example, if the name dis ...

Guide for setting the value of an input field using an unordered list generated from ajax in Selenium Webdriver with C#

The HTML structure of the form input is as follows: <span> <input type="hidden" name="color"> <!-- start async created --> <ul> <li value="green">Green</li> <li value="blue">Blue</li ...

How can I easily add both horizontal and vertical arrows to components in React?

Creating a horizontal line is as simple as using the following code: <hr style={{ width: "80%", border: "1px solid black" }} /> You can customize the width, length, and other properties as needed. If you want to display an arrow ...

The hover function stops working once the dropdown class has been removed

I am currently experimenting with a bootstrap template. In the navigation bar, there is an option for "Blog" and "Test". For the "Test" button, I decided to remove the li class="dropdown " because I wanted to create a button that changes color on hover si ...

Make sure the font size on your iPhone matches the font size on other web browsers

Once upon a time, I came across an insightful article detailing a method to size text using CSS that is compatible with multiple browsers. The approach outlined in the article includes: body { font-size:100%; line-height:1.125em; /* 16×1.125=18 * ...

Creating an HTML form that communicates with PHP and ASPX

I recently completed a project where I created a contact us page that sends information to our sales team using PHP for email delivery. The next step in this process is to also send the same customer information to our Sales Fusion CRM system. To accompli ...

Expand the div to fit 100% width inside the Blueprint container

I am currently working on a website and considering using the Blueprint CSS framework. You can view the site I'm referencing here: http://jsfiddle.net/timkl/uaSe3/ The Blueprint framework allows for a nice 24 column grid layout. One challenge I&apos ...

Choosing a dynamic dropdown option using jQuery and AJAX

I am facing an issue with a select box that is dynamically populated and should display information about a single option. The problem I am encountering is that the browser does not trigger a ':selected' event when I click on any of the options. ...

CSS container design with customized paragraph formatting

How can I format a CSS container for quotes that span multiple paragraphs? Here is an example of the code: #quotebox { width: 80%; border-top: 1px solid #242729; padding-left: 10%; padding-bottom: 2%; } I am currently using this CSS container for quotes, ...