Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7679179
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T17:49:06+00:00 2026-05-31T17:49:06+00:00

I’m trying to implement a horizontal dropdown menu into my website and I’ve run

  • 0

I’m trying to implement a horizontal dropdown menu into my website and I’ve run into a few problems:

1.I want to display the dropdown menu permanently,even when the user has moved the mouse pointer away from one of the link in the main menu like in this example: http://www.msn.com .
I think that I have to use jQuery for that,but I don’t have any experience with javascript.

2.How do I center the text in the dropdown ul? At the moment it looks like this:
https://i.stack.imgur.com/J3TQx.png

3.When I use chrome dev tools I can see that nav ul items are outside the nav block,why is this happening? How can I fix it without using position: absolute; ,it’s not a problem atm but It will be if someone wants to add another main menu item with wordpress but doesn’t know how to edit the css.
https://i.stack.imgur.com/CYyfn.png

html:

<header>
<div id="wrap">     
    <a id="logo" href="<?php bloginfo('siteurl');?>" title="Vratite se na  početnu stranicu" >
         <img src="<?php bloginfo('template_url');?>/images/logo.png"     alt="Obrtnička Škola Koprivnica Logo" width="53" height="70" />
    </a>
    <h1>OBRTNIČKA ŠKOLA KOPRIVNICA</h1>
    <nav>
         <?php wp_nav_menu( array('menu' => 'Main' , 'container' => none)); ?>
    </nav>
</div>

css:
header {
height: 75px;
background: url(images/background.png);
background-repeat-x: repeat;
border-bottom: 4px solid #0094e4;
box-shadow: 0 2px 5px #ccc;
padding: 1px;
}

#wrap {
min-width: 740px;
max-width: 1180px;
height: 75px;
margin: 0 auto;
}

#logo {
position: relative;
float: left;
margin: 3px 15px 3px 0;

}

nav {
width: 535px;
height: 25px;
}

nav ul li {
margin: 0 10px 0 1px;
display: inline;
list-style: none;
line-height: 25px; 
padding-bottom: 14px;
}

nav ul li a {
color: white;
line-height: 25px;
font-size: 1.2em;
}

nav ul ul {
display: none;
position: absolute;
top: 75px;
}

nav ul ul a {
color: black;
font-size: 0.9em;
}

nav ul li:hover > ul {
display: block;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T17:49:08+00:00Added an answer on May 31, 2026 at 5:49 pm

    Here’s a fiddle example.

    I used the horizontal links pattern from pea.rs. Complimented it with the clearfix micro hack and did some simple jQuery.

    There are multiple ways to do this. What I did is do the basic nested horizontal list. I used CSS to position the the secondary sub-menu below the main menu with absolute positioning. Just like MSN.com, I allocated space for there to always be some kind of menu or empty space by adding padding to the bottom of the main nav to fit the sub-nav.

    With CSS, I moved the sub-nav off the screen with the common “left:-999em” pattern and re-positioned it when the main menu item has the “active” class.

    All that is left is a small jQuery script to remove all “active” classes when hoving over a new item and re-adding the “active” class to the newly hovered item.

    1. To permanently display the item, you use only the “onMouseOver” javascript function. This way, it only fires when you first hover the item and isn’t removed or reset when you hover off.

    2. To easily align center the sub-nav to the main-nav, you make the sub-nav items inline-block. However note, inline-block isn’t well supported in older versions of IE but there are things you can do to work with that.

    3. Sorry, I didn’t spend any time on this question because my code isn’t based off your code.

    Hopefully this will help!
    Cheers!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a French site that I want to parse, but am running into
i want to parse a xhtml file and display in UITableView. what is the
Basically, what I'm trying to create is a page of div tags, each has
I want to count how many characters a certain string has in PHP, but
I used javascript for loading a picture on my website depending on which small
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I am trying to render a haml file in a javascript response like so:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.