www.webdeveloper.com
Results 1 to 3 of 3

Thread: Menu problem with repetition of image.

  1. #1
    Join Date
    Sep 2006
    Posts
    20

    Menu problem with repetition of image.

    Hi,
    Iv got a problem on this test page - http://80.244.186.152/mobilechoiceUK/
    can anyone tell me why the hover menus repeats the image as I do not want this to happen. I need it to function like this -http://www.mobilechoiceuk.com/Home

    Here is the css code ------------------------------------------------------
    HTML Code:
    .mainmenu {
    	BACKGROUND: url(bg.gif) no-repeat 0px 0px; WIDTH: 100%
    }
    .mainmenu UL {
    	LIST-STYLE-TYPE: none
    }
    .mainmenu LI {
    	PADDING-RIGHT: 2px; PADDING-LEFT: 0px; Z-INDEX: 100; BACKGROUND: url(divider.gif) no-repeat 100% 0px; FLOAT: left; PADDING-BOTTOM: 0px; PADDING-TOP: 0px; POSITION: relative
    }
    .mainmenu TABLE {
    	Z-INDEX: 80; LEFT: 0px; POSITION: absolute; TOP: 32px
    }
    .mainmenu A {
    	DISPLAY: block; FONT-WEIGHT: bold; FONT-SIZE: 0.7em; COLOR: #000; HEIGHT: 32px
    }
    .mainmenu LI.item1 A {
    	BACKGROUND: url(item1.gif) no-repeat 0px 0px; WIDTH: 59px
    }
    .mainmenu LI.item2 A {
    	BACKGROUND: url(item2.gif) no-repeat 0px 0px; WIDTH: 58px
    }
    .mainmenu LI.item3 A {
    	BACKGROUND: url(item3.gif) no-repeat 0px 0px; WIDTH: 76px
    }
    .mainmenu LI.item4 A {
    	BACKGROUND: url(item4.gif) no-repeat 0px 0px; WIDTH: 70px
    }
    .mainmenu LI.item5 A {
    	BACKGROUND: url(item5.gif) no-repeat 0px 0px; WIDTH: 60px
    }
    .mainmenu LI.item6 A {
    	BACKGROUND: url(item6.gif) no-repeat 0px 0px; WIDTH: 112px
    }
    .mainmenu LI.item7 A {
    	BACKGROUND: url(item7.gif) no-repeat 0px 0px; WIDTH: 45px
    }
    .mainmenu LI.item8 A {
    	BACKGROUND: url(item8.gif) no-repeat 0px 0px; WIDTH: 85px
    }
    .mainmenu LI.item9 A {
    	BACKGROUND: url(item9.gif) no-repeat 0px 0px; WIDTH: 65px
    }
    .mainmenu LI.item10 A {
    	BACKGROUND: url(item10.gif) no-repeat 0px 0px; WIDTH: 85px
    }
    .mainmenu LI.act A {
    	BACKGROUND-POSITION: 0px -32px
    }
    .mainmenu LI A:hover {
    	BACKGROUND-POSITION: 0px -32px
    }
    .mainmenu UL UL {
    	PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: url(child.gif) no-repeat 0px 100%; VISIBILITY: hidden; PADDING-BOTTOM: 5px; WIDTH: 200px; PADDING-TOP: 4px; POSITION: absolute
    }
    .mainmenu UL LI:hover UL {
    	VISIBILITY: visible
    }
    .mainmenu UL A:hover UL {
    	VISIBILITY: visible
    }
    .mainmenu UL UL LI {
    	PADDING-RIGHT: 0px! important; DISPLAY: inline; PADDING-LEFT: 0px! important; BACKGROUND: #f0f0f0 ; PADDING-BOTTOM: 0px! important; MARGIN: 0px 0px 0px 4px; WIDTH: 192px; PADDING-TOP: 0px! important
    }
    .mainmenu UL UL LI A {
    	PADDING-RIGHT: 10px; PADDING-LEFT: 10px; BACKGROUND: none transparent scroll repeat 0% 0%; FLOAT: none; PADDING-BOTTOM: 5px; WIDTH: auto! important; PADDING-TOP: 5px; HEIGHT: auto! important
    }
    .mainmenu UL UL LI A:hover {
    	BACKGROUND: #d8d8d8; TEXT-DECORATION: none
    }
    .mainmenu LI.search {
    	PADDING-RIGHT: 10px; PADDING-LEFT: 0px; BACKGROUND: none transparent scroll repeat 0% 0%; FLOAT: right; PADDING-BOTTOM: 0px; PADDING-TOP: 5px
    }
    .mainmenu LI.search INPUT {
    	VERTICAL-ALIGN: middle
    }
    .mainmenu LI.search SELECT {
    	VERTICAL-ALIGN: middle
    }
    .mainmenu LI.search INPUT.txt {
    	WIDTH: 92px
    }
    .mainmenu LI.search SELECT {
    	WIDTH: 92px
    }
    .mainmenu LI.search SELECT {
    	MARGIN: 0px 6px 0px 4px
    
    Here is the page code:----------------------------------------------------
    
    <!-- MAINMENU START -->
    <DIV class=mainmenu >
    <FORM action="" method=post>
    <UL>
      <LI class=item1><A title=Home href="http://www.mobilechoiceuk.com/Home"><SPAN 
      class=hidden>Home</SPAN></A></LI>
      <LI class=item2><A title=News 
      href="http://www.mobilechoiceuk.com/Latest-News"><SPAN 
    class=hidden>News</SPAN><!--[if IE 7]><! --></A><!--<![endif]--><!--[if lte IE 6]><table><tr><td><![endif]-->
        <UL>
        <LI><A href="http://www.mobilechoiceuk.com/Latest-News">Latest news</A></LI>
        <LI><A href="http://www.mobilechoiceuk.com/Phone-news">Phone news</A></LI>
        <LI><A href="http://www.mobilechoiceuk.com/Operator-news">Operator 
        news</A></LI>
        <LI><A href="http://www.mobilechoiceuk.com/Tariff-news">Tariff news</A></LI>
        <LI><A href="http://www.mobilechoiceuk.com/Accessory-news">Accessory 
        news</A></LI>
        <LI><A href="http://www.mobilechoiceuk.com/Content-news">Content 
        news</A></LI></UL><!--[if lte IE 6]></td></tr></table></a><![endif]--></LI>
      <LI class=item3><A title=Reviews 
      href="http://www.mobilechoiceuk.com/Reviews"><SPAN class=hidden>Reviews</SPAN><!--[if IE 7]><! --></A><!--<![endif]--><!--[if lte IE 6]><table><tr><td><![endif]-->
      <UL>
        <LI><A href="http://www.mobilechoiceuk.com/Phone-Reviews">Phones</A></LI>
        <LI><A href="http://www.mobilechoiceuk.com/Accessories">Accessories</A></LI>
        <LI><A href="http://www.mobilechoiceuk.com/Games">Games</A></LI></UL><!--[if lte IE 6]></td></tr></table></a><![endif]--></LI>
      <LI class=item4><A title=Phones 
      href="http://www.mobilechoiceuk.com/Phones"><SPAN class=hidden>Phones</SPAN><!--[if IE 7]><! -->
      </A>
        <!--<![endif]--><!--[if lte IE 6]><table><tr><td><![endif]-->
        <UL>
        <LI><A 
        href="http://www.mobilechoiceuk.com/Phones?company_name=Nokia">Nokia</A></LI>
        <LI><A 
        href="http://www.mobilechoiceuk.com/Phones?company_name=Samsung">Samsung</A></LI>
        <LI><A 
        href="http://www.mobilechoiceuk.com/Phones?company_name=Motorola">Motorola</A></LI>
        <LI><A 
        href="http://www.mobilechoiceuk.com/Phones?company_name=Sony+Ericsson">Sony 
        Ericsson</A></LI>
        <LI><A 
        href="http://www.mobilechoiceuk.com/Phones?company_name=LG">LG</A></LI>
        <LI><A 
        href="http://www.mobilechoiceuk.com/Phones?company_name=Apple">Apple</A></LI>
        <LI><A 
        href="http://www.mobilechoiceuk.com/Phones?company_name=BlackBerry">BlackBerry</A></LI>
        <LI><A 
        href="http://www.mobilechoiceuk.com/Phones?company_name=HTC">HTC</A></LI>
        <LI><A 
    href="http://www.mobilechoiceuk.com/Phones/?company_name=3">3</A></LI>
        <LI><A 
        href="http://www.mobilechoiceuk.com/Phones/?company_name=Alcatel">Alcatel</A></LI>
        <LI><A 
        href="http://www.mobilechoiceuk.com/Phones/?company_name=E-Ten">E-Ten</A></LI>
        <LI><A 
        href="http://www.mobilechoiceuk.com/Phones/?company_name=Fly+Mobile">Fly 
        Mobile</A></LI>
        <LI><A 
        href="http://www.mobilechoiceuk.com/Phones/?company_name=HP">HP</A></LI>
        <LI><A 
        href="http://www.mobilechoiceuk.com/Phones/?company_name=MWG">MWG</A></LI>
        <LI><A 
        href="http://www.mobilechoiceuk.com/Phones/?company_name=O2">O2</A></LI>
        <LI><A 
        href="http://www.mobilechoiceuk.com/Phones/?company_name=Palm">Palm</A></LI>
        <LI><A 
        href="http://www.mobilechoiceuk.com/Phones/?company_name=Sagem">Sagem</A></LI>
        <LI><A 
        href="http://www.mobilechoiceuk.com/Phones/?company_name=Sennheiser">Sennheiser</A></LI>
        <LI><A 
        href="http://www.mobilechoiceuk.com/Phones/?company_name=Sharp">Sharp</A></LI>
        <LI><A 
        href="http://www.mobilechoiceuk.com/Phones/?company_name=T-Mobile">T-Mobile</A></LI>
        <LI><A 
        href="http://www.mobilechoiceuk.com/Phones/?company_name=Toshiba">Toshiba</A></LI>
        <LI><A href="http://www.mobilechoiceuk.com/Comparison-tool">Compare 
        Phones</A></LI></UL><!--[if lte IE 6]></td></tr></table></a><![endif]--></LI>
      <LI class=item5><A title=Deals 
      href="http://www.mobilechoiceuk.com/Deals"><SPAN class=hidden>Deals</SPAN><!--[if IE 7]><! -->
      </A>
        <!--<![endif]--><!--[if lte IE 6]><table><tr><td><![endif]-->
      <UL>
        <LI><A href="http://www.mobilechoiceuk.com/Most-popular-deals">Most popular 
        deals</A></LI>
        <LI><A href="http://www.mobilechoiceuk.com/Editors-deal-of-the-day">Editor's 
        phone of the day</A></LI>
        <LI><A href="http://www.mobilechoiceuk.com/Top-deals">Top deals of the 
        week</A></LI>
        <LI><A href="http://www.mobilechoiceuk.com/Deals">See all deals</A></LI></UL><!--[if lte IE 6]></td></tr></table></a><![endif]--></LI>
      <LI class=item6><A title="The magazine" 
      href="http://www.mobilechoiceuk.com/The-magazine"><SPAN class=hidden>The 
      magazine</SPAN></A></LI>
      
      <LI class=item7><A title=Win href="http://www.mobilechoiceuk.com/Win"><SPAN 
      class=hidden>Win</SPAN><!--[if IE 7]><! --></A><!--<![endif]--><!--[if lte IE 6]><table><tr><td><![endif]-->
      <UL>
        <LI><A href="http://www.mobilechoiceuk.com/Win-Terms">Terms &amp; 
        Conditions</A></LI></UL><!--[if lte IE 6]></td></tr></table></a><![endif]--></LI>
      <LI class=item8><A title=Glossary 
      href="http://www.mobilechoiceuk.com/Glossary"><SPAN 
      class=hidden>Glossary</SPAN></A> 
      
    <!--li class="search"><label for="search_txt"><input type="text" name="" id="search_txt" class="txt" /></label><label for="search_select"><select name="" id="search_select"><option selected="selected">All</option></select></label><input type="image" src="assets/images/mainmenu/btn.gif" alt="Search" /></li>--></LI>
    </UL>
    <DIV class=clear></DIV></FORM></DIV><!-- MAINMENU END -->

    Any help appreciated, thank you.
    Last edited by WebJoel; 04-10-2008 at 06:18 PM.

  2. #2
    Join Date
    Mar 2006
    Location
    Newcastle NSW Australia
    Posts
    4,033
    This is due to specificy - the rule .mainmenu LI.item1 A for example is more specific than the general .mainmenu UL UL LI A due to the class name and will over-ride it. The fix here would be to move the top level class names from the <li>s (which contain the submenus) to the <a>s
    Code:
    <LI><A title=Home href="http://www.mobilechoiceuk.com/Home" class="item1">
    and alter the css accordingly
    Code:
    .mainmenu a.item1 {
    	BACKGROUND: url(item1.gif) no-repeat 0px 0px; WIDTH: 59px
    }

  3. #3
    Join Date
    Sep 2006
    Posts
    20
    Thanks a million Centauri that worked great!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center

"

"

X vBulletin 4.2.2 Debug Information

  • Page Generation 0.10642 seconds
  • Memory Usage 2,903KB
  • Queries Executed 13 (?)
More Information
Template Usage (34):
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_global_above_footer
  • (1)ad_global_below_navbar
  • (1)ad_global_header1
  • (1)ad_global_header2
  • (1)ad_navbar_below
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)ad_thread_first_post_content
  • (1)ad_thread_last_post_content
  • (2)bbcode_code
  • (1)bbcode_html
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)headinclude_bottom
  • (3)memberaction_dropdown
  • (1)navbar
  • (4)navbar_link
  • (1)navbar_moderation
  • (1)navbar_noticebit
  • (1)navbar_tabs
  • (2)option
  • (3)postbit
  • (3)postbit_onlinestatus
  • (3)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available (6):
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files (26):
  • ./showthread.php
  • ./global.php
  • ./includes/class_bootstrap.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/functions_navigation.php
  • ./includes/class_friendly_url.php
  • ./includes/class_hook.php
  • ./includes/class_bootstrap_framework.php
  • ./vb/vb.php
  • ./vb/phrase.php
  • ./includes/functions_facebook.php
  • ./includes/functions_calendar.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_notice.php
  • ./packages/vbattach/attach.php
  • ./vb/types.php
  • ./vb/cache.php
  • ./vb/cache/db.php
  • ./vb/cache/observer/db.php
  • ./vb/cache/observer.php 

Hooks Called (70):
  • init_startup
  • friendlyurl_resolve_class
  • init_startup_session_setup_start
  • database_pre_fetch_array
  • database_post_fetch_array
  • init_startup_session_setup_complete
  • global_bootstrap_init_start
  • global_bootstrap_init_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • load_show_variables
  • load_forum_show_variables
  • global_state_check
  • global_bootstrap_complete
  • global_start
  • style_fetch
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • strip_bbcode
  • friendlyurl_clean_fragment
  • friendlyurl_geturl
  • forumjump
  • cache_templates
  • cache_templates_process
  • template_register_var
  • template_render_output
  • fetch_template_start
  • fetch_template_complete
  • parse_templates
  • fetch_musername
  • notices_check_start
  • notices_noticebit
  • process_templates_complete
  • friendlyurl_redirect_canonical
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • memberaction_dropdown
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • build_navigation_data
  • build_navigation_array
  • check_navigation_permission
  • process_navigation_links_start
  • process_navigation_links_complete
  • set_navigation_menu_element
  • build_navigation_menudata
  • build_navigation_listdata
  • build_navigation_list
  • set_navigation_tab_main
  • set_navigation_tab_fallback
  • navigation_tab_complete
  • fb_like_button
  • showthread_complete
  • page_templates