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 6898569
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T07:18:46+00:00 2026-05-27T07:18:46+00:00

I’m designing a horizontal menu where I use a simple one-colored image of the

  • 0

I’m designing a horizontal menu where I use a simple one-colored image of the full menu bar, and a second image for the hover state, which is a bit darker. Actually I made just one image containing both, but that’s not the point.

My problems are :

  1. Hover image displays over the correct full width of each list item,
    but it’s only a link (showing hand) when hovering the text.
  2. My attempt of double-class attributes to adjust position of hover image on first/last list item does not work. It seems this code is never reached..? Hence as image shows, I do not get adjusted the x-position of hover image.

Please note I started with CSS a few days ago, so there are likely some basic concepts I’ve not yet understood..

enter image description here

    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>index</title>
        <meta name="author" content="SS" />
        <!-- Date: 2011-11-26 -->
        <link href="site2.css" rel="stylesheet"type="text/css" />
    </head>
    <body>
        <div class="header-wrap">
            header
        </div>
        <div class="main-wrap">
            <div class="main-content">
                <div class="inner-header">
                    inner header
                </div>
                <div class="navbox">
                    <div class="navmenu">
                        <ul class="ul_nav">
                            <li class="nav-item nav-item-first">
                                <a href="index.html">Home</a>
                            </li>
                            <li class="nav-item">
                                <a href="">Page1</a>
                            </li>
                            <li class="nav-item">
                                <a href="">Page2</a>
                            </li>
                            <li class="nav-item nav-item-last">
                                <a href="">Page3</a>
                            </li>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
        <div class="lower-content">
            lower-content
        </div>
        <div class="footer">
            footer
        </div>
    </body>
</html>

CSS:

    /* Basics */
body {
    background: #888 url() center 30px;
    font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
    color: #000;
    text-align: center;
    margin: 0 auto;
}
/* Main divs */
.header-wrap {
    background: #ddd;
    height: 35px;
    color: #00f;
}
.main-wrap {
    background: #000 url(07h600a.png) no-repeat center 0;
    margin: 0 auto;
}
.main-content {
    overflow: hidden;
    position: relative;
    z-index: 10;
    background: transparent; /* to be transparent*/
    height: 600px;
    margin: 0 auto;
    width: 980px;
}
.lower-content {
    background: #000;
    color: #888;
    height: 100px;
}
.footer {
    background: #777;
    height: 100px;
    margin: 0 auto;
}
/* Content */
/* Menu */
.navbox {
    background: #660;
    position: relative;
    padding: 0px 0 0 0;
    margin: 0 auto 0px;
    font-weight: bold;
    font-size: 12px;
    line-height: 40px;
    height: 50px;
    width: 980px;
    margin: 0 auto;
}
.navmenu {
    margin: 0 auto 0px;
    padding: 0 0 0 0;
    width: 980px;
}
.ul_nav {
    margin: 0;
    padding: 0;
    list-style: none outside none;
    text-transform: uppercase;
}
.navmenu .ul_nav {
    width: 980px;
    position: relative;
    display: table;
}
.ul_nav li {
    display: table-cell;
}
.ul_nav a, .ul_nav a:visited {

    padding: 0 0;
    text-decoration: none;
    color: #fff;
}
.navmenu .nav-item {
    background: transparent url(MenuGray.png) no-repeat scroll;
    background-position: 50% -10px;

}
.navmenu .nav-item-first {
    background-position: 0px -10px;
}
.navmenu .nav-item-last {
    background-position: 100% -10px;
}
/* Menu hover */
.ul_nav  .nav-item-first li:hover {
        background: transparent url(MenuGray.png) no-repeat scroll;
    background-position: 0px -50px;
}
.ul_nav  .nav-item-last li:hover {
    background-position: 100% -50px;
}
.ul_nav li:hover {
    background-position: 50% -60px;
}

/* Menu font */
.ul_nav_color a, .ul_nav_color a:visited {
    color: #FFF;
}
  • 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-27T07:18:47+00:00Added an answer on May 27, 2026 at 7:18 am

    For

    1. You need to make sure the a tag fills the li parent by setting it to display block or inline-block and adjust padding, margin, etc., to have its edge match up to the li edge. This will get you a link over the whole space, not just the text.
    2. You have the li listed after the class for the li, so you need this:

      .ul_nav .nav-item-first:hover
      

      Not

      .ul_nav  .nav-item-first li:hover
      
    • 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
I'm trying to select an H1 element which is the second-child in its group
I'm making a simple page using Google Maps API 3. My first. One marker
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
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
I am reading a book about Javascript and jQuery and using one of the
I want use html5's new tag to play a wav file (currently only supported
I am doing a simple coin flipping experiment for class that involves flipping a

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.