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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T18:59:05+00:00 2026-06-04T18:59:05+00:00

I am designing a custom navigation menu, which you can see in it’s current

  • 0

I am designing a custom navigation menu, which you can see in it’s current state here. Each individual navigation item looks like this:

navigation item

So essentially each nav item ‘hangs’ from a horizontal bar. The main part of the image is made up of three slices of an image:

Left: enter image description here Right: enter image description here and middle: enter image description here

The background for the middle DIV has repeat-x applied, so that it will grow to fit the content of the navigation items, i.e. the text.

This is the CSS I currently have for the left, right and middle DIVs:

.left {
    float: left;
    width: 13px;
    background-image: url(nav/images/nav_01.png);
    background-repeat: no-repeat;
    height:46px;
    margin-left:2%;
}

.middle {
    width:auto;
    float:left;
    background-image: url(nav/images/nav_02.png);
    background-repeat: repeat-x;
    font-size:20px;
    font-family: Typewriter;
    color:#393526;
    height:46px;
    padding-left:1px;
}

.right {
    float: left;
    width: 13px;
    background-image: url(nav/images/nav_03.png);
    background-repeat: no-repeat;
    height:46px;
}

So far so good, but I then had to work out how to include the vertical bar that joins the main horizontal bar to the image constructed for the nav items, so that it was always centred. The way I did it was to include a div for it within the middle div as follows:

<li>
<div class="nav_image">
<div class="left"></div>
<div class="middle"><div class="top"></div>home</div>
<div class="right"></div>
</div>
</li>

and then apply a negative margin-top to the ‘top’ DIV:

.top {
    height:27px;
    background-image: url(nav/images/top.png);
    background-repeat: no-repeat;
    background-position-x: center;
    margin-top:-24px;
}

and a positive margin-top to the ‘nav_image’ DIV:

.nav_image {
    margin-top:27px;
}

I’m not sure if this is the best way to achieve what I am looking for, but it is working so far.

The issue I am having is setting a background color for the ‘nav_image’ DIV. I would like to set a color for this, and another color on hover. I was hoping that I could add rounded corners to this DIV and then set a background color for this that would show behind the background image.

At the moment the DIV ‘nav_image’ is showing a width of 1200px and a height of 0px though. I would have thought it would have inherited the total width of the three child DIVS, i.e. left, middle and right, but clearly this is not what is happening. So I don’t seem to have a DIV to apply the background color to.

I hope this is clear, thanks for reading, and I’d be glad to get any advice on this.

Nick.

  • 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-06-04T18:59:06+00:00Added an answer on June 4, 2026 at 6:59 pm

    1) add these to the css:

    ul#list-nav li {
        float:left;
        display:inline;
    }
    
    .clear {
        clear:both;
    }
    

    2) add <div class="clear"></div> after each <div class="right"></div>

    3) remove .left‘s margin-left: 2%; (add margin to ul#list-nav li instead)

    the nav_image should have correct width and height now

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

Sidebar

Related Questions

I'm working on Expression Blend and I'm currently designing a custom control which has
I'm currently designing a custom tab control class which derives from System.Windows.Forms.Control. The problem
I am designing a Framework library which can be used to store a hierarchically
I am working in android. i am designing a custom dialog in which there
I am designing a custom widget which is basically a QGroupBox holding a configurable
I am designing a custom HTML helper and I would like to execute Html.ActionLink
I am in the process of designing a custom media type for a RESTful
I am designing a database for a system where billing occurs at regular, custom
When defining a custom operator from the limited set of single-character operators that can
In my app, I'm designing a custom picker that allows the user to choose

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.