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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T22:13:03+00:00 2026-05-22T22:13:03+00:00

I have the following code <ul id =menu> <%foreach (var pckg in Model) {

  • 0

I have the following code

<ul id ="menu">
    <%foreach (var pckg in Model)
    { %>

        <li style = "text-align:center;width:60px;" class = "top-<%=pckg.Controller.ToLower() %>"> 
            li-text
        </li>

    <%} %>

</ul>

and following is the sprite CSS

.top-pkg1{ background-position: -184px 0; width: 36px; height: 36px; } 
.top-pkg2{ background-position: -270px 0; width: 36px; height: 36px; } 
.top-pkg3{ background-position: -356px 0; width: 36px; height: 36px; } 
.top-pkg4{ background-position: -517px 0; width: 36px; height: 36px; } 
.top-pkg5{ background-position: -603px 0; width: 36px; height: 31px; } 
.top-pkg5{ background-position: -689px 0; width: 36px; height: 36px; } 
.top-pkg6{ background-position: -775px 0; width: 36px; height: 36px; } 
.top-pkg7{ background-position: -861px 0; width: 36px; height: 36px; } 

and here is the container css

 #menu li
    {
         display:block;
         background: url(/Content/images/TopMenu/topmenu.png) no-repeat top left; 

    }    
    #menu li a
    {
        margin-top:35px;
        text-align:center;    
    }

But when i ran this code i get the first image of the sprite partially shown on all li tags Couldn’t figure out the problem. I created the css from Here
Fiddle link is
http://jsfiddle.net/tassadaque/LnGqX/1/

  • 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-22T22:13:04+00:00Added an answer on May 22, 2026 at 10:13 pm

    @tassadaque; You already define background-position in your li image url top left

    background: url(/Content/images/TopMenu/topmenu.png) no-repeat top left;
    

    So remove top left position from your li image url and write like this:

    background: url(/Content/images/TopMenu/topmenu.png) no-repeat;
    

    Edit
    write :

    #menu li {background: url(/Content/images/TopMenu/topmenu.png) no-repeat;}
    
    #menu li.top-pkg1{ background-position: -184px 0; width: 36px; height: 36px; }
    #menu li.top-pkg2{ background-position: -270px 0; width: 36px; height: 36px; }
    #menu li.top-pkg3{ background-position: -356px 0; width: 36px; height: 36px; }
    #menu li.top-pkg4{ background-position: -20px 0; width: 36px; height: 36px; }
    #menu li.top-pkg5{ background-position: -603px 0; width: 36px; height: 31px; }
    #menu li.top-pkg5{ background-position: -689px 0; width: 36px; height: 36px; }
    #menu li.top-pkg6{ background-position: -775px 0; width: 36px; height: 36px; }
    #menu li.top-pkg7{ background-position: -861px 0; width: 36px; height: 36px; }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi I have the following code <ul id=sample-menu-1 class=sf-menu> <li class=current><a href=#a>main item <span
I have the following PHP code: $required_fields = array ('menu_name','visible','position'); foreach($required_fields as $fieldname) {
I have the following code which work fine: $('.ui-selectmenu-menu a').click(function() { alert('OK'); }); However,
I have the following code for a menu system which includes a lot of
I have the following code to layout the menu for my page: //Header Conainer
I have the following code... internal sealed class Menu_Metadata { private Menu_Metadata() { }
I have the following code here at http://forum.castoff.net/menu.php When i click the little x
i have the following code ,which draws mandelbrot set.I created a menu with an
I have the following code: XAML: <Window x:Class=ContextMenuIssue.MainWindow xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml Title=MainWindow Height=350 Width=525> <Grid>
I have the following code for my popup menu, the parent link is the

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.