Having trouble with setting background image for Menu control

Last post 08-21-2008 2:42 PM by r.heinkens. 6 replies.

Sort Posts:

  • Having trouble with setting background image for Menu control

    08-18-2008, 3:40 PM
    • Member
      429 point Member
    • r.heinkens
    • Member since 04-29-2008, 1:26 PM
    • Groningen
    • Posts 120

    Hi all,

    I am having trouble with setting the background image of a static meny item. It are all standard menu items and I am setting the style to the items as follows via CSS:

    .staticMenuItem

    {

    background-image: url('/Images/StaticMenuItemBackgroundHover.jpg');

    }

    The image looks totally messed. It is spread across the menuitem. Please let me know how I should set the image for my background, including a repeater.

    Cheers,

    Rodney
    IT Consultant
  • Re: Having trouble with setting background image for Menu control

    08-18-2008, 4:46 PM
    • Member
      44 point Member
    • alghawks
    • Member since 02-04-2008, 3:11 PM
    • Posts 27

     Just looking at my current project, I don't use Background-image. It is just background: url(....);

     Haven't tried it the other way.

  • Re: Having trouble with setting background image for Menu control

    08-18-2008, 5:06 PM
    • Member
      337 point Member
    • NYCharles
    • Member since 05-02-2008, 7:42 PM
    • New York City
    • Posts 78

    Try to put the following line after your background-image. It will prevent the image to tile in both x and y direction.

     

     

    background-repeat: no-repeat;
      
  • Re: Having trouble with setting background image for Menu control

    08-20-2008, 5:25 AM
    • Member
      429 point Member
    • r.heinkens
    • Member since 04-29-2008, 1:26 PM
    • Groningen
    • Posts 120

    I have tried both solutions, but no success. I want an image to be repeated across the width of the button.

    Cheers,

    Rodney
    IT Consultant
  • Re: Having trouble with setting background image for Menu control

    08-21-2008, 2:47 AM

    Hi,

    Do you want to pull the image to fill the area of the menuitem?

    You can try to use the filter to stretch the image, for example:

      .staticMenuItem
    {
         filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true,src='../image/button-search.gif',sizingMethod='scale');
    }

    Amanda Wang
    Microsoft Online Community Support

    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
  • Re: Having trouble with setting background image for Menu control

    08-21-2008, 2:34 PM
    • Member
      429 point Member
    • r.heinkens
    • Member since 04-29-2008, 1:26 PM
    • Groningen
    • Posts 120
    I have tried this:

    .staticMenuItem

    {

    filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true,src='/Images/StaticMenuItemBackgroundHover.jpg',sizingMethod='scale');

    }

    But now I cannot click the links of the menu anymore. The image is showing though :) Am I still doing something wrong here? I am assuming this will only work for IE and/or MS OS?

    Cheers,

    Rodney
    IT Consultant
  • Re: Having trouble with setting background image for Menu control

    08-21-2008, 2:42 PM
    • Member
      429 point Member
    • r.heinkens
    • Member since 04-29-2008, 1:26 PM
    • Groningen
    • Posts 120

    Oh yeah, the other solutions didn't help me either.

    Cheers,

    Rodney
    IT Consultant
Page 1 of 1 (7 items)