Webmaster Forums Banner Professional Hosting from Just Host
Welcome Guest Search | Active Topics | Members | Log In | Register

using images in asp.net menu control Options
hari
Posted: Saturday, June 07, 2008 4:35:47 PM
Rank: Advanced Member
Groups: Member

Joined: 3/31/2008
Posts: 61
Points: 183
Location: NY
Okay, I'm sure this has been covered, but I did a search on "graphics in Menus" here and came up short so...

I have my menu set up and oriented like I want, but I want to use an image in my menu "tab" (it's not a tab, it's an asp:menu using a CSS to set my font, background color and tryng to set my image) but I want the image to be behind every page in the menu

but what I'm getting is a tiled look so that each item in the menu does not have the image in it or it's not centered correctly. Here is my CSS:

Code:
.menus
{
    font-family: Arial, Verdana, Helvetica, sans-serif;
    color: red;
    background-position: 15% 0%;
    background-image: url(images/applebutton.JPG);
    background-repeat: repeat-x;
    background-color: transparent;
}


Can anyone help me with this? TIA
Sponsor
Posted: Saturday, June 07, 2008 4:35:47 PM
hissan
Posted: Saturday, June 07, 2008 4:37:04 PM
Rank: Advanced Member
Groups: Member

Joined: 1/31/2008
Posts: 33
Points: 99
Location: Pakistan
Hi Try this,

Code:
<%@ Page Language= "VB" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<style type="text/css">
.menuItem
{
color:black;
border:Solid 1px Gray;
background-color:#c9c9c9;
background-image : url(http://www.gc.ca/images/lfblt.gif);
padding:2px 5px;
}
</style>
<title>Menu Templates</title>
</head>
<body>
<form id="form1" runat="server">
<div>

<asp:Menu
id="Menu1"
Orientation="Horizontal"
StaticMenuItemStyle-CssClass="menuItem"
DynamicMenuItemStyle-CssClass="menuItem"
Runat="server">

<Items>
<asp:MenuItem Text="Produce">
<asp:MenuItem Text="Apples" />
<asp:MenuItem Text="Oranges" />
</asp:MenuItem>
<asp:MenuItem Text="Beverages">
<asp:MenuItem Text="Soda">
<asp:MenuItem Text="Coke" />
<asp:MenuItem Text="Pepsi" />
</asp:MenuItem>
</asp:MenuItem>
</Items>
</asp:Menu>

</div>
</form>
</body>
</html>


Hope this helps.
Users browsing this topic
Guest


Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Main Forum RSS : RSS

ASPNET Theme created by Boskone (Dan Ferguson)
Powered by HaqTech.Com
Copyright © 2003-2006 Yet Another Forum.net. All rights reserved.
This page was generated in 0.524 seconds.