473,385 Members | 2,162 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Problem with asp menu (background image of MenuItem)

Hello!

I'm programmatically inserting a navigation asp menu to a page, like
this:

// Create new Menu
Menu menu = new Menu();

// Create new MenuItem
MenuItem mainItem = new MenuItem();
mainItem.Text = _text;
mainItem.Selectable = false;

// Fill the MenuItem with ChildItems
for (int i = 0; i < _entries.Count; i++)
{
mainItem.ChildItems.Add(_entries[i].CreateControl());
}

// Set some Menu properties (css classes)
menu.Items.Add(mainItem);
menu.DisappearAfter = 250;
menu.Style.Clear();
menu.StaticHoverStyle.CssClass = "StaticHoverStyle";
menu.StaticMenuItemStyle.CssClass = "StaticMenuItemStyle";
menu.StaticMenuStyle.CssClass = "StaticMenuStyle";
menu.DynamicHoverStyle.CssClass = "DynamicHoverStyle";
menu.DynamicMenuItemStyle.CssClass = "DynamicMenuItemStyle";
menu.DynamicMenuStyle.CssClass = "DynamicMenuStyle";
menu.Orientation = Orientation.Horizontal;
menu.StaticEnableDefaultPopOutImage = false;
menu.DynamicEnableDefaultPopOutImage = false;

return menu;
Basically each menu that gets returned (in above function) is a menu
with one menu item which look like this:
http://www.kizej.com/~primozh/x/image.bmp

If you look closely, you see that the background of the text is
basically the background of the MenuItem. WHY is this happening?
Here is the CSS:

..StaticMenuStyle
{
}
..StaticMenuItemStyle
{
width: 110px;
height: 25px;
color: #5a5a5a;
font-family:Arial;
font-size: 11px;
background-image: url(images/ButtonBasicActive.jpg);
}

Background image looks like this:
http://www.kizej.com/~primozh/x/ButtonBasicActive.jpg
Can anyone tell me why is the background image of the text the same as
the background image of the MenuItem?

Nov 16 '06 #1
1 11997
..StaticMenuItemStyle A:link
{
background-image: none;
}

is the solution...

Nov 16 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Derek Fountain | last post by:
I have a horizontal navigation bar, which is a single row table containing the right images. It "stretches" itself across the screen using a penultimate td like this: <td width="100%"...
2
by: chris_culley | last post by:
Hi, I'm fairly new to using css, and have been using it to format a vertical navigation bar on my website, producing a load of buttons on top of each other, each with a (151 * 33 px) gif as the...
1
by: Andrew Poulos | last post by:
I'm working with one of those vertical menus that use CSS and lists. The menu is contained with a DIV (DIV.1) with a height of 100% that's within an absolutely positioned DIV (DIV.2). DIV.1 has a...
1
by: Littlefire | last post by:
Hi all I wrote a proxy script that fetches images out of a database and sends the data to the browser, using the Content-type header. For instance, if I'm loading a jpg image from the database,...
2
by: H | last post by:
is it possible to add a background image to the menu items? I can add an image, but it displays on top of the text of the menu items. How can I add the image and still have the text in the...
6
by: thallasridevi | last post by:
Hello, This is sridevi. I have a problem with background images. I am selecting the background images dynamially in my code and when a background image is selected, it is interfereing with the...
16
by: stevedude | last post by:
CSS newbie again. I have a problem trying to get coffee mug images within anchor tags to center with my link text for a vertical list menu. If I use the horizontal/vertical properties of...
2
by: thephatp | last post by:
I'm having a problem with IE rendering correctly. I'm experimenting with using all div's in my pages now, and I'm not very familiar with the quirks of IE. I have created a sample page, and I'm...
20
by: mahmoodn | last post by:
There is a problem with background image in my HTML file. I have written an HTML file and in that I add a background image. When I open it in firefox, it shows the background image but it does not...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.