473,386 Members | 1,668 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,386 software developers and data experts.

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 StaticSelectedStyle and StaticHoverStyle 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="Default.aspx.vb"
Inherits="_Default" %>

<!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 runat="server">
<title>Untitled 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">
<StaticSelectedStyle BackColor="Blue" />
<StaticHoverStyle 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 1454
Hi Richard,

Thanks for posting!

For the current issues, both StaticSelectedStyle and StaticHoverSytle
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 StaticSelectedStyle and StaticHoverSytle
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
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...
1
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...
4
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...
3
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
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...
1
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...
1
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...
2
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...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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,...

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.