2.0 menu control and color

T

Trapulo

I've created a menu control, that I use in my master page. I've a problem,
because my pages use a css that define a color for "A" tags that is
invisible over menu background. So I need that all menu's item have white as
forecolor, but I cannot make this. I've tried to set to "white" all
"forecolor" properties defined for the menu, but I've still links rendered
with same color defined in css.

How can I force links created by menu control to have a specific color,
different from default's one?

thanks
 
S

Steven Cheng[MSFT]

Hi Trapulo,

Welcome to ASPNET newsgroup.
As for the css hyperlink style applying problem you met, based on my
experience, as for such scenario, we need to define some custom css class
for our Menu Control's Menu item. We can customzie the hyperlink styles (A,
A:Hover, A:Visited.....) in that custom css class. For example, we define
the following css class:

..MenuLink A
{
color: Yellow
}

..MenuLink A:hover
{
color:White
}


Then, in the asp.net page, we apply this css class to our Menu control's
Static and Dynamic MenuItems through the following properties:

<asp:Menu>
<StaticMenuItemStyle CssClass="MenuLink" />
<DynamicMenuItemStyle CssClass="MenuLink" />
</asp:Menu>

This can help make our Menu control's MenuItems has its own customzed
hyperlink styles....

Hope helps. Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)




--------------------
| From: "Trapulo" <[email protected]>
| Subject: 2.0 menu control and color
| Date: Mon, 5 Dec 2005 22:46:43 +0100
| Lines: 13
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.3790.1830
| X-RFC2646: Format=Flowed; Original
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.1830
| Message-ID: <uj79eVe#[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
| NNTP-Posting-Host: host59-15.pool8252.interbusiness.it 82.52.15.59
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP09.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet.webcontrols:31555
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
|
| I've created a menu control, that I use in my master page. I've a problem,
| because my pages use a css that define a color for "A" tags that is
| invisible over menu background. So I need that all menu's item have white
as
| forecolor, but I cannot make this. I've tried to set to "white" all
| "forecolor" properties defined for the menu, but I've still links rendered
| with same color defined in css.
|
| How can I force links created by menu control to have a specific color,
| different from default's one?
|
| thanks
|
|
|
 
T

Trapulo

Hello Steven,
thank you for your reply. I've tried to work as you suggested, but I've
still some problem.

This is my css:
MenuLink A

{

color: White;

}

MenuLink A:hover

{

color:White;

}

A:link {

text-decoration: none;

color: #009E40;

}


A:visited {

text-decoration: none;

color: #009E40;

}


A:active {

text-decoration: none;

color: #009E40;

}


A:hover {

text-decoration: underline;

color: #6F6F6F;

}

And this is my asp.net menu:

<asp:Menu ID="Menu1" runat="server" BackColor="#009E40"
DynamicHorizontalOffset="2" Font-Names="Verdana" Font-Size="11px"
ForeColor="White" Orientation="Horizontal"

StaticSubMenuIndent="10px" EnableViewState="False" Width="100%"
Style="margin-bottom: 10px;" DynamicVerticalOffset="5"
StaticEnableDefaultPopOutImage="False" DataSourceID="sourceSite"
EnableTheming="True" ItemWrap="True">

<StaticMenuItemStyle CssClass="MenuLink" />

<DynamicMenuItemStyle CssClass="MenuLink" />

<DynamicHoverStyle BackColor="#666666" ForeColor="White" />



<StaticSelectedStyle BackColor="#1C5E55" ForeColor="White" />

<DynamicSelectedStyle BackColor="#1C5E55" ForeColor="White" />

<DynamicMenuItemStyle HorizontalPadding="5px" VerticalPadding="2px"
BackColor="#009E40" ForeColor="White" BorderStyle="None" Width="100px" />

<Items>

<asp:MenuItem Text="Mailing" Value="Mailing">

<asp:MenuItem NavigateUrl="~/Mailings.aspx" Text="Elenco"
Value="Elenco"></asp:MenuItem>

<asp:MenuItem NavigateUrl="~/Mailing.aspx" Text="Nuovo"
Value="Nuovo"></asp:MenuItem>

</asp:MenuItem>

<asp:MenuItem NavigateUrl="~/Default2.aspx" Text="test misti" Value="test
misti"></asp:MenuItem>

</Items>

<StaticHoverStyle BackColor="#666666" ForeColor="White" />

However, menu links are still rendered with #009E40 color :(

Here is how html is generated:

<div style="margin-top: 0px; width: 100%; padding-top: 0px; height: 24px;
background-color: #349bd6">
</div>
<a href="#ctl00_Menu1_SkipLink"><img alt="Skip Navigation Links"
src="/MassSenderWeb/WebResource.axd?d=8m4TBF3gbZy2FgVmK20EkA2&amp;t=632688759249687500"
width="0" height="0" style="border-width:0px;" /></a><table id="ctl00_Menu1"
class="ctl00_Menu1_2" cellpadding="0" cellspacing="0" border="0"
style="margin-bottom: 10px;">
<tr>
<td onmouseover="Menu_HoverStatic(this)" onmouseout="Menu_Unhover(this)"
onkeyup="Menu_Key(event)" id="ctl00_Menu1n0"><table class="MenuLink
ctl00_Menu1_4" cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td><a class="ctl00_Menu1_1 MenuLink ctl00_Menu1_3" href="#"
style="border-style:none;font-size:1em;cursor:text;">Mailing</a></td>
</tr>
</table></td><td style="width:3px;"></td><td
onmouseover="Menu_HoverStatic(this)" onmouseout="Menu_Unhover(this)"
onkeyup="Menu_Key(event)" id="ctl00_Menu1n1"><table class="MenuLink
ctl00_Menu1_4" cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td><a class="ctl00_Menu1_1 MenuLink ctl00_Menu1_3"
href="/MassSenderWeb/default2.aspx"
style="border-style:none;font-size:1em;">test vari</a></td>
</tr>
</table></td>
</tr>
</table><div id="ctl00_Menu1n0Items" class="ctl00_Menu1_0">
<table border="0" cellpadding="0" cellspacing="0">
<tr onmouseover="Menu_HoverDynamic(this)" onmouseout="Menu_Unhover(this)"
onkeyup="Menu_Key(event)" title="Elenco mailing correnti"
id="ctl00_Menu1n2">
<td><table class="MenuLink ctl00_Menu1_6 ctl00_Menu1_10" cellpadding="0"
cellspacing="0" border="0" width="100%">
<tr>
<td style="width:100%;"><a class="ctl00_Menu1_1 MenuLink ctl00_Menu1_5
ctl00_Menu1_9" href="/MassSenderWeb/mailings.aspx"
style="border-style:none;font-size:1em;">Elenco</a></td>
</tr>
</table></td>
</tr><tr onmouseover="Menu_HoverDynamic(this)"
onmouseout="Menu_Unhover(this)" onkeyup="Menu_Key(event)"
id="ctl00_Menu1n3">
<td><table class="MenuLink ctl00_Menu1_6" cellpadding="0" cellspacing="0"
border="0" width="100%">
<tr>
<td style="width:100%;"><a class="ctl00_Menu1_1 MenuLink ctl00_Menu1_5"
href="/MassSenderWeb/mailing.aspx"
style="border-style:none;font-size:1em;">Nuovo</a></td>
</tr>
</table></td>
</tr>
</table><div class="MenuLink ctl00_Menu1_6 ctl00_Menu1_10 ctl00_Menu1_0"
id="ctl00_Menu1n0ItemsUp" onmouseover="PopOut_Up(this)"
onmouseout="PopOut_Stop(this)" style="text-align:center;">
<img
src="/MassSenderWeb/WebResource.axd?d=9jpB2MUsl7POzORK_OCTq195yG0jQfAm1pfsMgnAOyA1&amp;t=632688759249687500"
alt="Scroll up" />
</div><div class="MenuLink ctl00_Menu1_6 ctl00_Menu1_10 ctl00_Menu1_0"
id="ctl00_Menu1n0ItemsDn" onmouseover="PopOut_Down(this)"
onmouseout="PopOut_Stop(this)" style="text-align:center;">
<img
src="/MassSenderWeb/WebResource.axd?d=oyB4Qfyn_gPkkRlODDVqjHh8QmXUenoyq-NaXFDiF1o1&amp;t=632688759249687500"
alt="Scroll down" />
</div>
Where is the error?

thanks
 
S

Steven Cheng[MSFT]

Thanks for your response Trapulo,

From the code you pasted here, I just noticed the below difference from
your CSS classes and mine:

Yours:
==============
This is my css:
MenuLink A
{
color: White;
}

MenuLink A:hover
{
color:White;
}
==============

Mine:
=============
..MenuLink A
{
color: White;
}

..MenuLink A:hover
{
color:White;
}
==========

I'm not sure whether this is a type mistake or .... We need to make sure
the "." dot is put before the class name since this is the CSS class's
definition syntax.... (But we don't need to add the dot when we use them in
page (html ....).

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)


--------------------
| From: "Trapulo" <[email protected]>
| References: <uj79eVe#[email protected]>
<WOlnolj#[email protected]>
| Subject: Re: 2.0 menu control and color
| Date: Tue, 6 Dec 2005 12:15:00 +0100
| Lines: 258
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.3790.1830
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.1830
| X-RFC2646: Format=Flowed; Original
| Message-ID: <#1uWIZl#[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
| NNTP-Posting-Host: host59-15.pool8252.interbusiness.it 82.52.15.59
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP09.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet.webcontrols:31571
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
|
| Hello Steven,
| thank you for your reply. I've tried to work as you suggested, but I've
| still some problem.
|
| This is my css:
| MenuLink A
|
| {
|
| color: White;
|
| }
|
| MenuLink A:hover
|
| {
|
| color:White;
|
| }
|
| A:link {
|
| text-decoration: none;
|
| color: #009E40;
|
| }
|
|
| A:visited {
|
| text-decoration: none;
|
| color: #009E40;
|
| }
|
|
| A:active {
|
| text-decoration: none;
|
| color: #009E40;
|
| }
|
|
| A:hover {
|
| text-decoration: underline;
|
| color: #6F6F6F;
|
| }
|
| And this is my asp.net menu:
|
| <asp:Menu ID="Menu1" runat="server" BackColor="#009E40"
| DynamicHorizontalOffset="2" Font-Names="Verdana" Font-Size="11px"
| ForeColor="White" Orientation="Horizontal"
|
| StaticSubMenuIndent="10px" EnableViewState="False" Width="100%"
| Style="margin-bottom: 10px;" DynamicVerticalOffset="5"
| StaticEnableDefaultPopOutImage="False" DataSourceID="sourceSite"
| EnableTheming="True" ItemWrap="True">
|
| <StaticMenuItemStyle CssClass="MenuLink" />
|
| <DynamicMenuItemStyle CssClass="MenuLink" />
|
| <DynamicHoverStyle BackColor="#666666" ForeColor="White" />
|
|
|
| <StaticSelectedStyle BackColor="#1C5E55" ForeColor="White" />
|
| <DynamicSelectedStyle BackColor="#1C5E55" ForeColor="White" />
|
| <DynamicMenuItemStyle HorizontalPadding="5px" VerticalPadding="2px"
| BackColor="#009E40" ForeColor="White" BorderStyle="None" Width="100px" />
|
| <Items>
|
| <asp:MenuItem Text="Mailing" Value="Mailing">
|
| <asp:MenuItem NavigateUrl="~/Mailings.aspx" Text="Elenco"
| Value="Elenco"></asp:MenuItem>
|
| <asp:MenuItem NavigateUrl="~/Mailing.aspx" Text="Nuovo"
| Value="Nuovo"></asp:MenuItem>
|
| </asp:MenuItem>
|
| <asp:MenuItem NavigateUrl="~/Default2.aspx" Text="test misti" Value="test
| misti"></asp:MenuItem>
|
| </Items>
|
| <StaticHoverStyle BackColor="#666666" ForeColor="White" />
|
| However, menu links are still rendered with #009E40 color :(
|
| Here is how html is generated:
|
| <div style="margin-top: 0px; width: 100%; padding-top: 0px; height: 24px;
| background-color: #349bd6">
| </div>
| <a href="#ctl00_Menu1_SkipLink"><img alt="Skip Navigation Links"
|
src="/MassSenderWeb/WebResource.axd?d=8m4TBF3gbZy2FgVmK20EkA2&amp;t=63268875
9249687500"
| width="0" height="0" style="border-width:0px;" /></a><table
id="ctl00_Menu1"
| class="ctl00_Menu1_2" cellpadding="0" cellspacing="0" border="0"
| style="margin-bottom: 10px;">
| <tr>
| <td onmouseover="Menu_HoverStatic(this)"
onmouseout="Menu_Unhover(this)"
| onkeyup="Menu_Key(event)" id="ctl00_Menu1n0"><table class="MenuLink
| ctl00_Menu1_4" cellpadding="0" cellspacing="0" border="0" width="100%">
| <tr>
| <td><a class="ctl00_Menu1_1 MenuLink ctl00_Menu1_3" href="#"
| style="border-style:none;font-size:1em;cursor:text;">Mailing</a></td>
| </tr>
| </table></td><td style="width:3px;"></td><td
| onmouseover="Menu_HoverStatic(this)" onmouseout="Menu_Unhover(this)"
| onkeyup="Menu_Key(event)" id="ctl00_Menu1n1"><table class="MenuLink
| ctl00_Menu1_4" cellpadding="0" cellspacing="0" border="0" width="100%">
| <tr>
| <td><a class="ctl00_Menu1_1 MenuLink ctl00_Menu1_3"
| href="/MassSenderWeb/default2.aspx"
| style="border-style:none;font-size:1em;">test vari</a></td>
| </tr>
| </table></td>
| </tr>
| </table><div id="ctl00_Menu1n0Items" class="ctl00_Menu1_0">
| <table border="0" cellpadding="0" cellspacing="0">
| <tr onmouseover="Menu_HoverDynamic(this)"
onmouseout="Menu_Unhover(this)"
| onkeyup="Menu_Key(event)" title="Elenco mailing correnti"
| id="ctl00_Menu1n2">
| <td><table class="MenuLink ctl00_Menu1_6 ctl00_Menu1_10"
cellpadding="0"
| cellspacing="0" border="0" width="100%">
| <tr>
| <td style="width:100%;"><a class="ctl00_Menu1_1 MenuLink
ctl00_Menu1_5
| ctl00_Menu1_9" href="/MassSenderWeb/mailings.aspx"
| style="border-style:none;font-size:1em;">Elenco</a></td>
| </tr>
| </table></td>
| </tr><tr onmouseover="Menu_HoverDynamic(this)"
| onmouseout="Menu_Unhover(this)" onkeyup="Menu_Key(event)"
| id="ctl00_Menu1n3">
| <td><table class="MenuLink ctl00_Menu1_6" cellpadding="0"
cellspacing="0"
| border="0" width="100%">
| <tr>
| <td style="width:100%;"><a class="ctl00_Menu1_1 MenuLink
ctl00_Menu1_5"
| href="/MassSenderWeb/mailing.aspx"
| style="border-style:none;font-size:1em;">Nuovo</a></td>
| </tr>
| </table></td>
| </tr>
| </table><div class="MenuLink ctl00_Menu1_6 ctl00_Menu1_10 ctl00_Menu1_0"
| id="ctl00_Menu1n0ItemsUp" onmouseover="PopOut_Up(this)"
| onmouseout="PopOut_Stop(this)" style="text-align:center;">
| <img
|
src="/MassSenderWeb/WebResource.axd?d=9jpB2MUsl7POzORK_OCTq195yG0jQfAm1pfsMg
nAOyA1&amp;t=632688759249687500"
| alt="Scroll up" />
| </div><div class="MenuLink ctl00_Menu1_6 ctl00_Menu1_10 ctl00_Menu1_0"
| id="ctl00_Menu1n0ItemsDn" onmouseover="PopOut_Down(this)"
| onmouseout="PopOut_Stop(this)" style="text-align:center;">
| <img
|
src="/MassSenderWeb/WebResource.axd?d=oyB4Qfyn_gPkkRlODDVqjHh8QmXUenoyq-NaXF
DiF1o1&amp;t=632688759249687500"
| alt="Scroll down" />
| </div>
| Where is the error?
|
| thanks
|
|
|
| | > As for the css hyperlink style applying problem you met, based on my
| > experience, as for such scenario, we need to define some custom css
class
| > for our Menu Control's Menu item. We can customzie the hyperlink styles
| > (A,
| > A:Hover, A:Visited.....) in that custom css class. For example, we
define
| > the following css class:
| >
| > MenuLink A
| > {
| > color: Yellow
| > }
| >
| > MenuLink A:hover
| > {
| > color:White
| > }
| >
| >
| > Then, in the asp.net page, we apply this css class to our Menu control's
| > Static and Dynamic MenuItems through the following properties:
| >
| > <asp:Menu>
| > <StaticMenuItemStyle CssClass="MenuLink" />
| > <DynamicMenuItemStyle CssClass="MenuLink" />
| > </asp:Menu>
| >
| > This can help make our Menu control's MenuItems has its own customzed
| > hyperlink styles....
| >
| > Hope helps. Thanks,
| >
| > Steven Cheng
| > Microsoft Online Support
| >
| > Get Secure! www.microsoft.com/security
| > (This posting is provided "AS IS", with no warranties, and confers no
| > rights.)
| >
| >
| >
| >
| > --------------------
| > | From: "Trapulo" <[email protected]>
| > | Subject: 2.0 menu control and color
| > | Date: Mon, 5 Dec 2005 22:46:43 +0100
| > | Lines: 13
| > | X-Priority: 3
| > | X-MSMail-Priority: Normal
| > | X-Newsreader: Microsoft Outlook Express 6.00.3790.1830
| > | X-RFC2646: Format=Flowed; Original
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.1830
| > | Message-ID: <uj79eVe#[email protected]>
| > | Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
| > | NNTP-Posting-Host: host59-15.pool8252.interbusiness.it 82.52.15.59
| > | Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP09.phx.gbl
| > | Xref: TK2MSFTNGXA02.phx.gbl
| > microsoft.public.dotnet.framework.aspnet.webcontrols:31555
| > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
| > |
| > | I've created a menu control, that I use in my master page. I've a
| > problem,
| > | because my pages use a css that define a color for "A" tags that is
| > | invisible over menu background. So I need that all menu's item have
| > white
| > as
| > | forecolor, but I cannot make this. I've tried to set to "white" all
| > | "forecolor" properties defined for the menu, but I've still links
| > rendered
| > | with same color defined in css.
| > |
| > | How can I force links created by menu control to have a specific
color,
| > | different from default's one?
| > |
| > | thanks
| > |
| > |
| > |
| >
|
|
|
 
T

Trapulo

I'm sorry, but I cannot see any "." on the code you posted. Some strange
newsreader's problem?

However, based on your description, I added a "." before "MenuLink", and now
it works. In fact, I needed to overwrite all A "variants" with this code:

..MenuLink A

{

color: White;

}

..MenuLink A:hover

{

color:White;

}

..MenuLink A:link {

color:White;

}


..MenuLink A:visited {

color:White;

}


..MenuLink A:active {

color:White;

}



Now it's all ok: thank you for you help!
 
S

Steven Cheng[MSFT]

You're welcome Trapulo,

Glad that it works for you.
Have a nice day!

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| From: "Trapulo" <[email protected]>
| References: <uj79eVe#[email protected]>
<WOlnolj#[email protected]>
<#1uWIZl#[email protected]>
<SFCFKAv#[email protected]>
| Subject: Re: 2.0 menu control and color
| Date: Wed, 7 Dec 2005 23:10:51 +0100
| Lines: 403
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.3790.1830
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.1830
| X-RFC2646: Format=Flowed; Original
| Message-ID: <O7hRQs3#[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
| NNTP-Posting-Host: host229-15.pool8248.interbusiness.it 82.48.15.229
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet.webcontrols:31618
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
|
| I'm sorry, but I cannot see any "." on the code you posted. Some strange
| newsreader's problem?
|
| However, based on your description, I added a "." before "MenuLink", and
now
| it works. In fact, I needed to overwrite all A "variants" with this code:
|
| .MenuLink A
|
| {
|
| color: White;
|
| }
|
| .MenuLink A:hover
|
| {
|
| color:White;
|
| }
|
| .MenuLink A:link {
|
| color:White;
|
| }
|
|
| .MenuLink A:visited {
|
| color:White;
|
| }
|
|
| .MenuLink A:active {
|
| color:White;
|
| }
|
|
|
| Now it's all ok: thank you for you help!
|
|
|
|
| | > Thanks for your response Trapulo,
| >
| > From the code you pasted here, I just noticed the below difference from
| > your CSS classes and mine:
| >
| > Yours:
| > ==============
| > This is my css:
| > MenuLink A
| > {
| > color: White;
| > }
| >
| > MenuLink A:hover
| > {
| > color:White;
| > }
| > ==============
| >
| > Mine:
| > =============
| > MenuLink A
| > {
| > color: White;
| > }
| >
| > MenuLink A:hover
| > {
| > color:White;
| > }
| > ==========
| >
| > I'm not sure whether this is a type mistake or .... We need to make
sure
| > the "." dot is put before the class name since this is the CSS class's
| > definition syntax.... (But we don't need to add the dot when we use
them
| > in
| > page (html ....).
| >
| > Thanks,
| >
| > Steven Cheng
| > Microsoft Online Support
| >
| > Get Secure! www.microsoft.com/security
| > (This posting is provided "AS IS", with no warranties, and confers no
| > rights.)
| >
| >
| > --------------------
| > | From: "Trapulo" <[email protected]>
| > | References: <uj79eVe#[email protected]>
| > <WOlnolj#[email protected]>
| > | Subject: Re: 2.0 menu control and color
| > | Date: Tue, 6 Dec 2005 12:15:00 +0100
| > | Lines: 258
| > | X-Priority: 3
| > | X-MSMail-Priority: Normal
| > | X-Newsreader: Microsoft Outlook Express 6.00.3790.1830
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.1830
| > | X-RFC2646: Format=Flowed; Original
| > | Message-ID: <#1uWIZl#[email protected]>
| > | Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
| > | NNTP-Posting-Host: host59-15.pool8252.interbusiness.it 82.52.15.59
| > | Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP09.phx.gbl
| > | Xref: TK2MSFTNGXA02.phx.gbl
| > microsoft.public.dotnet.framework.aspnet.webcontrols:31571
| > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
| > |
| > | Hello Steven,
| > | thank you for your reply. I've tried to work as you suggested, but
I've
| > | still some problem.
| > |
| > | This is my css:
| > | MenuLink A
| > |
| > | {
| > |
| > | color: White;
| > |
| > | }
| > |
| > | MenuLink A:hover
| > |
| > | {
| > |
| > | color:White;
| > |
| > | }
| > |
| > | A:link {
| > |
| > | text-decoration: none;
| > |
| > | color: #009E40;
| > |
| > | }
| > |
| > |
| > | A:visited {
| > |
| > | text-decoration: none;
| > |
| > | color: #009E40;
| > |
| > | }
| > |
| > |
| > | A:active {
| > |
| > | text-decoration: none;
| > |
| > | color: #009E40;
| > |
| > | }
| > |
| > |
| > | A:hover {
| > |
| > | text-decoration: underline;
| > |
| > | color: #6F6F6F;
| > |
| > | }
| > |
| > | And this is my asp.net menu:
| > |
| > | <asp:Menu ID="Menu1" runat="server" BackColor="#009E40"
| > | DynamicHorizontalOffset="2" Font-Names="Verdana" Font-Size="11px"
| > | ForeColor="White" Orientation="Horizontal"
| > |
| > | StaticSubMenuIndent="10px" EnableViewState="False" Width="100%"
| > | Style="margin-bottom: 10px;" DynamicVerticalOffset="5"
| > | StaticEnableDefaultPopOutImage="False" DataSourceID="sourceSite"
| > | EnableTheming="True" ItemWrap="True">
| > |
| > | <StaticMenuItemStyle CssClass="MenuLink" />
| > |
| > | <DynamicMenuItemStyle CssClass="MenuLink" />
| > |
| > | <DynamicHoverStyle BackColor="#666666" ForeColor="White" />
| > |
| > |
| > |
| > | <StaticSelectedStyle BackColor="#1C5E55" ForeColor="White" />
| > |
| > | <DynamicSelectedStyle BackColor="#1C5E55" ForeColor="White" />
| > |
| > | <DynamicMenuItemStyle HorizontalPadding="5px" VerticalPadding="2px"
| > | BackColor="#009E40" ForeColor="White" BorderStyle="None"
Width="100px"
| > />
| > |
| > | <Items>
| > |
| > | <asp:MenuItem Text="Mailing" Value="Mailing">
| > |
| > | <asp:MenuItem NavigateUrl="~/Mailings.aspx" Text="Elenco"
| > | Value="Elenco"></asp:MenuItem>
| > |
| > | <asp:MenuItem NavigateUrl="~/Mailing.aspx" Text="Nuovo"
| > | Value="Nuovo"></asp:MenuItem>
| > |
| > | </asp:MenuItem>
| > |
| > | <asp:MenuItem NavigateUrl="~/Default2.aspx" Text="test misti"
| > Value="test
| > | misti"></asp:MenuItem>
| > |
| > | </Items>
| > |
| > | <StaticHoverStyle BackColor="#666666" ForeColor="White" />
| > |
| > | However, menu links are still rendered with #009E40 color :(
| > |
| > | Here is how html is generated:
| > |
| > | <div style="margin-top: 0px; width: 100%; padding-top: 0px; height:
| > 24px;
| > | background-color: #349bd6">
| > | </div>
| > | <a href="#ctl00_Menu1_SkipLink"><img alt="Skip Navigation
Links"
| > |
| >
src="/MassSenderWeb/WebResource.axd?d=8m4TBF3gbZy2FgVmK20EkA2&amp;t=63268875
| > 9249687500"
| > | width="0" height="0" style="border-width:0px;" /></a><table
| > id="ctl00_Menu1"
| > | class="ctl00_Menu1_2" cellpadding="0" cellspacing="0" border="0"
| > | style="margin-bottom: 10px;">
| > | <tr>
| > | <td onmouseover="Menu_HoverStatic(this)"
| > onmouseout="Menu_Unhover(this)"
| > | onkeyup="Menu_Key(event)" id="ctl00_Menu1n0"><table class="MenuLink
| > | ctl00_Menu1_4" cellpadding="0" cellspacing="0" border="0"
width="100%">
| > | <tr>
| > | <td><a class="ctl00_Menu1_1 MenuLink ctl00_Menu1_3" href="#"
| > | style="border-style:none;font-size:1em;cursor:text;">Mailing</a></td>
| > | </tr>
| > | </table></td><td style="width:3px;"></td><td
| > | onmouseover="Menu_HoverStatic(this)" onmouseout="Menu_Unhover(this)"
| > | onkeyup="Menu_Key(event)" id="ctl00_Menu1n1"><table class="MenuLink
| > | ctl00_Menu1_4" cellpadding="0" cellspacing="0" border="0"
width="100%">
| > | <tr>
| > | <td><a class="ctl00_Menu1_1 MenuLink ctl00_Menu1_3"
| > | href="/MassSenderWeb/default2.aspx"
| > | style="border-style:none;font-size:1em;">test vari</a></td>
| > | </tr>
| > | </table></td>
| > | </tr>
| > | </table><div id="ctl00_Menu1n0Items" class="ctl00_Menu1_0">
| > | <table border="0" cellpadding="0" cellspacing="0">
| > | <tr onmouseover="Menu_HoverDynamic(this)"
| > onmouseout="Menu_Unhover(this)"
| > | onkeyup="Menu_Key(event)" title="Elenco mailing correnti"
| > | id="ctl00_Menu1n2">
| > | <td><table class="MenuLink ctl00_Menu1_6 ctl00_Menu1_10"
| > cellpadding="0"
| > | cellspacing="0" border="0" width="100%">
| > | <tr>
| > | <td style="width:100%;"><a class="ctl00_Menu1_1 MenuLink
| > ctl00_Menu1_5
| > | ctl00_Menu1_9" href="/MassSenderWeb/mailings.aspx"
| > | style="border-style:none;font-size:1em;">Elenco</a></td>
| > | </tr>
| > | </table></td>
| > | </tr><tr onmouseover="Menu_HoverDynamic(this)"
| > | onmouseout="Menu_Unhover(this)" onkeyup="Menu_Key(event)"
| > | id="ctl00_Menu1n3">
| > | <td><table class="MenuLink ctl00_Menu1_6" cellpadding="0"
| > cellspacing="0"
| > | border="0" width="100%">
| > | <tr>
| > | <td style="width:100%;"><a class="ctl00_Menu1_1 MenuLink
| > ctl00_Menu1_5"
| > | href="/MassSenderWeb/mailing.aspx"
| > | style="border-style:none;font-size:1em;">Nuovo</a></td>
| > | </tr>
| > | </table></td>
| > | </tr>
| > | </table><div class="MenuLink ctl00_Menu1_6 ctl00_Menu1_10
ctl00_Menu1_0"
| > | id="ctl00_Menu1n0ItemsUp" onmouseover="PopOut_Up(this)"
| > | onmouseout="PopOut_Stop(this)" style="text-align:center;">
| > | <img
| > |
| >
src="/MassSenderWeb/WebResource.axd?d=9jpB2MUsl7POzORK_OCTq195yG0jQfAm1pfsMg
| > nAOyA1&amp;t=632688759249687500"
| > | alt="Scroll up" />
| > | </div><div class="MenuLink ctl00_Menu1_6 ctl00_Menu1_10 ctl00_Menu1_0"
| > | id="ctl00_Menu1n0ItemsDn" onmouseover="PopOut_Down(this)"
| > | onmouseout="PopOut_Stop(this)" style="text-align:center;">
| > | <img
| > |
| >
src="/MassSenderWeb/WebResource.axd?d=oyB4Qfyn_gPkkRlODDVqjHh8QmXUenoyq-NaXF
| > DiF1o1&amp;t=632688759249687500"
| > | alt="Scroll down" />
| > | </div>
| > | Where is the error?
| > |
| > | thanks
| > |
| > |
| > |
| > | | > | > As for the css hyperlink style applying problem you met, based on my
| > | > experience, as for such scenario, we need to define some custom css
| > class
| > | > for our Menu Control's Menu item. We can customzie the hyperlink
| > styles
| > | > (A,
| > | > A:Hover, A:Visited.....) in that custom css class. For example, we
| > define
| > | > the following css class:
| > | >
| > | > MenuLink A
| > | > {
| > | > color: Yellow
| > | > }
| > | >
| > | > MenuLink A:hover
| > | > {
| > | > color:White
| > | > }
| > | >
| > | >
| > | > Then, in the asp.net page, we apply this css class to our Menu
| > control's
| > | > Static and Dynamic MenuItems through the following properties:
| > | >
| > | > <asp:Menu>
| > | > <StaticMenuItemStyle CssClass="MenuLink" />
| > | > <DynamicMenuItemStyle CssClass="MenuLink" />
| > | > </asp:Menu>
| > | >
| > | > This can help make our Menu control's MenuItems has its own
customzed
| > | > hyperlink styles....
| > | >
| > | > Hope helps. Thanks,
| > | >
| > | > Steven Cheng
| > | > Microsoft Online Support
| > | >
| > | > Get Secure! www.microsoft.com/security
| > | > (This posting is provided "AS IS", with no warranties, and confers
no
| > | > rights.)
| > | >
| > | >
| > | >
| > | >
| > | > --------------------
| > | > | From: "Trapulo" <[email protected]>
| > | > | Subject: 2.0 menu control and color
| > | > | Date: Mon, 5 Dec 2005 22:46:43 +0100
| > | > | Lines: 13
| > | > | X-Priority: 3
| > | > | X-MSMail-Priority: Normal
| > | > | X-Newsreader: Microsoft Outlook Express 6.00.3790.1830
| > | > | X-RFC2646: Format=Flowed; Original
| > | > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.1830
| > | > | Message-ID: <uj79eVe#[email protected]>
| > | > | Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
| > | > | NNTP-Posting-Host: host59-15.pool8252.interbusiness.it 82.52.15.59
| > | > | Path:
| > TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP09.phx.gbl
| > | > | Xref: TK2MSFTNGXA02.phx.gbl
| > | > microsoft.public.dotnet.framework.aspnet.webcontrols:31555
| > | > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
| > | > |
| > | > | I've created a menu control, that I use in my master page. I've a
| > | > problem,
| > | > | because my pages use a css that define a color for "A" tags that
is
| > | > | invisible over menu background. So I need that all menu's item
have
| > | > white
| > | > as
| > | > | forecolor, but I cannot make this. I've tried to set to "white"
all
| > | > | "forecolor" properties defined for the menu, but I've still links
| > | > rendered
| > | > | with same color defined in css.
| > | > |
| > | > | How can I force links created by menu control to have a specific
| > color,
| > | > | different from default's one?
| > | > |
| > | > | thanks
| > | > |
| > | > |
| > | > |
| > | >
| > |
| > |
| > |
| >
|
|
|
 
A

Artem Kliatchkine

Hi All,

I have a problem which is probably close to this. I need to create a
menu with transparent items so that dynamic submenu appear transparent.
In DynamicMenuItemStyle, DynamicMenuStyle and DynamicHoverStyle I put
both ForeColor and BackColor to transparent. It doesn't help.

Does someone know how to do this?

Thanks,
Artem
 
T

Trapulo

I think you can use Steven's suggest, and set bg color to transparent in
your css. Does it works?
 
A

Artem Kliatchkine

Trapulo said:
I think you can use Steven's suggest, and set bg color to transparent in
your css. Does it works?

No :-(
I applied a css class with background color set to transparent but it
looks just white space while I should see a site content through it. The
class was applied because text color changed but it doesn't make menu
items transparent.

I'm new in web programming, maybe I just don't understand something.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top