Steverino541
asked on
duplicate background images in asp.net menuitem
I am trying to change the look of the asp.net menu by setting a background image in my stylesheet but in the menu I get duplicate backgrounds like a separate background for the text in that menu item. I have written the following in the stylesheet:
.menuitem
{
background-image:url(./ima ges/menu_b g.gif);
width:180px;
height:25px;
color:White;
background-repeat:no-repea t;
}
and the source for the menu looks like this:
<asp:Menu ID="Menu1" runat="server">
<LevelMenuItemStyles>
<asp:MenuItemStyle BackColor="White" CssClass="menuitem" Font-Underline="False" ItemSpacing="5px" />
</LevelMenuItemStyles>
<Items>
<asp:MenuItem Text="Overview" Value="Overview"></asp:Men uItem>
<asp:MenuItem Text="Contacts" Value="Contacts"></asp:Men uItem>
</Items>
</asp:Menu>
Am I missing something?
.menuitem
{
background-image:url(./ima
width:180px;
height:25px;
color:White;
background-repeat:no-repea
}
and the source for the menu looks like this:
<asp:Menu ID="Menu1" runat="server">
<LevelMenuItemStyles>
<asp:MenuItemStyle BackColor="White" CssClass="menuitem" Font-Underline="False" ItemSpacing="5px" />
</LevelMenuItemStyles>
<Items>
<asp:MenuItem Text="Overview" Value="Overview"></asp:Men
<asp:MenuItem Text="Contacts" Value="Contacts"></asp:Men
</Items>
</asp:Menu>
Am I missing something?
ASKER
Here is how the colde locks in html:
<tr style="height:2px;">
<td></td>
</tr><tr style="height:2px;">
<td></td>
</tr><tr onmouseover="Menu_HoverSta tic(this)" onmouseout="Menu_Unhover(t his)" onkeyup="Menu_Key(this)" id="ctl00_Menu1n2">
<td><table class="menuitem ctl00_Menu1_6" cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td style="white-space:nowrap; width:100% ;"><a class="ctl00_Menu1_1 menuitem ctl00_Menu1_5" href="javascript:__doPostB ack('ctl00 $Menu1','C ontacts')" style="border-style:none;f ont-size:1 em;">Conta cts</a></t d>
</tr>
</table></td>
</tr>
<tr style="height:2px;">
<td></td>
</tr><tr style="height:2px;">
<td></td>
</tr><tr onmouseover="Menu_HoverSta
<td><table class="menuitem ctl00_Menu1_6" cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td style="white-space:nowrap;
</tr>
</table></td>
</tr>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
#Menu1
{
background-image:url(./ima
width:180px;
height:25px;
color:White;
background-repeat:no-repea
}
or better still.. once your page is rendered.. do a view source and paste the HTML here. we can then track down what level / element needs to be styled.