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

  • SEARCH
  • Home
  • 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 6188327
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T02:12:47+00:00 2026-05-24T02:12:47+00:00

Okay I have a drop down menu, before I put the drop down menu

  • 0

Okay I have a drop down menu, before I put the drop down menu in there the login image floated correctly (to the right) but now it wont float at all. How would I make the login image go back to the right side?

HTML

<ul id="nav">
    <li><a href="#" class="activenav"><img src="../images/home.png" alt=""/></a></li>
    <li><a href="#"><img src="../images/image.png" alt=""/></a>
        <ul>
            <li><a href="#">Link 1</a></li>
            <li><a href="#">Link 2</a></li>
            <li><a href="#">Link 3</a></li>
        </ul>
    <div class="clear"></div>
    </li>
    <li><a href="#"><img src="../images/image.png" alt=""/></a>
        <ul>
            <li><a href="#">Link 1</a></li>
            <li><a href="#">Link 2</a></li>
            <li><a href="#">Link 3</a></li>
        </ul>
    <div class="clear"></div>
    </li>
    <li><a href="#"><img src="../images/image.png" alt=""/></a>
        <ul>
            <li><a href="#">Link 1</a></li>
            <li><a href="#">Link 2</a></li>
            <li><a href="#">Link 3</a></li>
        </ul>
    <div class="clear"></div>
    </li>
    <li><a href="#" id="login"><img src="../images/login.png" alt=""/></a></li>
</ul>

CSS

#nav {
    background:url(../images/nav.png) repeat-x;
    margin:0;
    height:32px;
    padding:13px; /* specific due to the background image */
    padding-bottom:0;
    border-bottom:solid 1px rgba(0,0,0,.1);
    text-align:left; /* fixes text align */
}
#nav ul {
    margin:0;
    padding:0;
}
#nav img {
    margin:0;
    padding:0;
}
#nav a {
    color:rgb(255,255,255);
    text-decoration:none;
    padding:10px;
}
#nav a:hover {
    background:url(../images/navlink.png);
    border-radius:2px;
    -moz-border-radius:2px;
    -webkit-border-radius:2px;
}
#nav a.activenav {
    background:url(../images/navlink.png);
    border-radius:2px;
    -moz-border-radius:2px;
    -webkit-border-radius:2px;
}
#login {
    float:right;
    margin:-10px 0 0 0; /* important since #login is floating */
}
#nav #login:hover {
    background:transparent;
}
.clear {clear:both;} 
#nav li {
    float: left;
    position: relative;
}
#nav ul {
    background:url(../images/subnav.png);
    display: none;
    margin:13px 0 0 0;
    position:absolute;
    border-radius:3px;
    -moz-border-radius:3px;
    -webkit-border-radius:3px;
}
#nav ul li {
    clear:both;
    margin:12px 10px;
    width:150px;
}
#nav ul li a {
    margin:5px 0;
}

JQUERY

$(document).ready(function() {
    // drop down
    $('#nav li').hover(
        function() {
            $('ul', this).stop(true, true).fadeIn(50);
        },
        function() {
            $('ul', this).fadeOut(200);
        }
    );

});

I know the javascript has nothing to do with it but just in case.

  • 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-24T02:12:47+00:00Added an answer on May 24, 2026 at 2:12 am

    Your #login is floating to the right but it is floating to the right within its parent <li>, have a look at this borderized version and you’ll see:

    http://jsfiddle.net/ambiguous/YHs36/

    The easiest solution is to float the <li> to the right and then adjust the <a> a bit to get it positioned properly. You can change the CSS to this:

    #login {
        float: right !important; /* !important to override the float:left */
        margin:-10px 0 0 0; /* important since #login is floating */
    }
    #login a {
        display: block;
    }
    

    and then HTML like this:

    <li id="login"><a href="#"><img ...></a></li>
    

    Live example: http://jsfiddle.net/ambiguous/qww58/

    I replaced the login image with a kitten so that I could see where it was. And because I like kittens. Feel free to change it to http://placedog.com/ if you prefer dogs, dogs are cool too.

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

Sidebar

Related Questions

Okay i have a selection box(drop down menu) and a set of radio buttons.
Okay, here's what I'm attempting. I have a drop down list with all of
So I have a drop down menu that's supposed to be populated by a
okay i have found the way to run a video in a image.... the
Okay I have updated my code a little, but I am still not exactly
I'm trying to animate drop up using negative top, the animation went okay, but
Okay I have been trying to get this to work for some time now.
Okay I have seen some very similar questions here but none seem to be
Okay...I have a situation where a C# .dll is a singleton. Now, what I
I have created the following drop down for my front-end webpage: <select> <option value=All>All</option>

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.