473,597 Members | 2,174 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Menu background colors not set when CSS used.

My simple example is shown below. Please can you explain why the BackColor of
the menu's StaticSelectedS tyle and StaticHoverStyl e are not applied whilst
the background-color of the tr and td's are applied via the style. Thanks.

<%@ Page Language="VB" AutoEventWireup ="false" CodeFile="Defau lt.aspx.vb"
Inherits="_Defa ult" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitl ed Page</title>
<style type="text/css">
tr{background-color: ButtonFace;}
td{background-color: ButtonFace;}
</style>
</head>
<body>
<form id="form1" runat="server">
<div>
<table>
<tr style="height: 200px;">
<td style="width: 200px;">
<asp:Menu ID="Menu1" runat="server">
<StaticSelected Style BackColor="Blue " />
<StaticHoverSty le BackColor="Red" />
<Items>
<asp:MenuItem Text="One"
Value="One"></asp:MenuItem>
<asp:MenuItem Text="Two"
Value="Two"></asp:MenuItem>
<asp:MenuItem Text="Three"
Value="Three"></asp:MenuItem>
</Items>
</asp:Menu>
</td>
</tr>
</table>
</div>
</form>
</body>
</html>

Feb 24 '06 #1
3 1460
Hi Richard,

Thanks for posting!

For the current issues, both StaticSelectedS tyle and StaticHoverSytl e
property aren't applied because that the menu control is rendered as td
element on the client side. However, you have set the style of td and tr
element by your own style. If you want to make these properties available,
I suggest you remove your own style for the page.

Thanks for your understanding!

Regards,

Yuan Ren [MSFT]
Microsoft Online Support
=============== =============== =============== =========
PLEASE NOTE the newsgroup SECURE CODE and PASSWORD were
updated on February 14, 2006. Please complete a re-registration process
by entering the secure code mmpng06 when prompted. Once you have
entered the secure code mmpng06, you will be able to update your profile
and access the partner newsgroups.
=============== =============== =============== =========
When responding to posts, please "Reply to Group" via your newsreader
so that others may learn and benefit from this issue.
=============== =============== =============== =========
This posting is provided "AS IS" with no warranties, and confers no rights.
=============== =============== =============== =========

Feb 24 '06 #2
Ok, I understand that the menu control is rendered as a td on the client
side, but surely the CSS order of precedence means the styles set for these
td's override any styles set in local or external styles?

You suggest that I "remove your own style for the page" but surely this
contradicts the whole idea of CSS. I want to implement a website-wide style
for all <tr> and <td> elements (so I'll put these in an external style sheet)
but, if I understand you correctly, this will mean that I can't set any
styles for any of the menu controls.
""Yuan Ren[MSFT]"" wrote:
Hi Richard,

Thanks for posting!

For the current issues, both StaticSelectedS tyle and StaticHoverSytl e
property aren't applied because that the menu control is rendered as td
element on the client side. However, you have set the style of td and tr
element by your own style. If you want to make these properties available,
I suggest you remove your own style for the page.

Thanks for your understanding!

Regards,

Yuan Ren [MSFT]
Microsoft Online Support
=============== =============== =============== =========
PLEASE NOTE the newsgroup SECURE CODE and PASSWORD were
updated on February 14, 2006. Please complete a re-registration process
by entering the secure code mmpng06 when prompted. Once you have
entered the secure code mmpng06, you will be able to update your profile
and access the partner newsgroups.
=============== =============== =============== =========
When responding to posts, please "Reply to Group" via your newsreader
so that others may learn and benefit from this issue.
=============== =============== =============== =========
This posting is provided "AS IS" with no warranties, and confers no rights.
=============== =============== =============== =========

Feb 24 '06 #3
Hi Richard,

Thanks for posting!

I understand your current issue. I think the specific way to approach your
demand is remove the style from whole td or tr style and write your own
customize style. This means you define the customize style in the css file
likes the ".MyStyle". And then, you can mark the td element as :
<td class="MyStyle" >
The same as tr element. Please notes don't mark the td or tr element which
contains the menu control. Thanks for your understanding!

Regards,

Yuan Ren [MSFT]
Microsoft Online Support
=============== =============== =============== =========
PLEASE NOTE the newsgroup SECURE CODE and PASSWORD were
updated on February 14, 2006. Please complete a re-registration process
by entering the secure code mmpng06 when prompted. Once you have
entered the secure code mmpng06, you will be able to update your profile
and access the partner newsgroups.
=============== =============== =============== =========
When responding to posts, please "Reply to Group" via your newsreader
so that others may learn and benefit from this issue.
=============== =============== =============== =========
This posting is provided "AS IS" with no warranties, and confers no rights.
=============== =============== =============== =========

Feb 27 '06 #4

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

Similar topics

1
5964
by: Josh | last post by:
Caution, newbie approaching... I'm trying to come up with a very simple Tkinter test application that consists of a window with a drop-down menu bar at the top and a grid of colored rectangles filling the remainder of the window. Mind you, this is a contrived test application to help me understand Tkinter and Python, not an actual application yet. I've trivially subclassed Tkinter.Canvas into ColorCanvas, added a bunch of ColorCanvases...
1
2853
by: Dennis M. Marks | last post by:
Is there a javascript alternative to the dropdown menu in a form (SELECT OPTION). I would like the ability to pass a selected item to a function but I would like more control in the design of the menu. I would like to have different colors within a single line of the menu and different colors on selected lines. It would also be nice to have the initial "button" a small size that would widen when dropped down. My existing page is within...
4
3829
by: JesusFreak | last post by:
From: us_traveller@yahoo.com (JesusFreak) Newsgroups: microsoft.public.scripting.jscript Subject: toolbar script problem NNTP-Posting-Host: 192.92.126.136 Recently, I downloaded the following beautiful script "http://javascript.internet.com/navigation/toolbar-menu.html". It works like a charm. I made my webpage in frames, where the nav-frame shows the menubar, so whenever I click a link in the menubar, it opens in the frame below. But...
3
4743
by: Peter Williams | last post by:
Hi All, I want to write some javascript for a html page which does the following. Imagine that the page contains a table with 2 columns and 3 rows, e.g.: +---+---+ | A | B | +---+---+
16
3929
by: J. B. Moreno | last post by:
I read the faq, and it mentions that IE 4 on windows requires setting a printing option to allow background colors to be printed. Things change, life goes on, other browsers come into existence.... So, is there a way in CSS to say "Yeah, print these background colors", without the user having to turn on an option that will then apply to all pages printed? Thanks,
1
1680
by: dkimbrell | last post by:
Hi there, I'm very novice to web design. I'm trying to make a pulldown menu, but the formatting keeps getting screwed up when you roll the mouse over it. Please see www.boundarysys.com for what I'm talking about. Before the mouse touches the pulldown, the vertical height of the menubar is perfect. As soon as the mouse rolls over it, it expands to about twice the height.
1
1765
by: leicklda | last post by:
Hi there, I'm very novice to web design. I'm trying to make a pulldown menu, but the formatting keeps getting screwed up when you roll the mouse over it. Please see www.boundarysys.com for what I'm talking about. Before the mouse touches the pulldown, the vertical height of the menubar is perfect. As soon as the mouse rolls over it, it expands to about twice
2
1410
by: elasticgurl | last post by:
I'm wondering if anyone has access to ie6 and can view my css and see if they can help me . As it stands, my menu looks different in both mac browsers and IE6. At this point, I haven't tested in IE7. Keeping my fingers crossed for now! What I need the menu is to look like is the menu on this page (with all the same hover background colors, margins and text colors): http://www.gseis.ucla.edu/~edd/www/_saba/index.html The page I need to...
0
7884
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8267
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8024
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8258
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6681
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5423
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3880
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
3921
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2394
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.