Solved

css menu

Posted on 2011-09-14
11
363 Views
Last Modified: 2012-05-12
Hey guys i have a asp menu and have convert the menu to ul li using css friendly

my problem is the child parent, i want the background red and font colour white

here my current image:

 current
my current css

 
/* MENU --------------------------------------------------------*/ 

.Menu
{
	margin-left:0px;
	background-color: #FFFFFF;
}

.Menu ul li
{
	font-family: 'Century Gothic';
	font-size: 15px;
	height: 34px;
	font-weight: normal;
	line-height: 34px;
	margin-right: 15px;
	margin-left: 15px;
}

.Menu ul li a
{
	color: #272974;
}

.Menu ul li a:hover
{
	color: #ed1f24;
}

.Menu .AspNet-Menu-Selected
{
	color: #ed1f24;
	font-weight: bold;
}

.Menu .AspNet-Menu-ChildSelected
{
	color: #ed1f24;
}

.Menu .AspNet-Menu-WithChildren
{

}

.Menu ul li ul
{
	width: auto;
	background-color: #ed1f24;
}

.Menu ul li ul li
{
	margin: 0px 0px 0px 15px;
	padding: 0;
	z-index: 2;
	line-height: 25px;
	white-space: nowrap;
	width: 187px;
	display: block;
}

.Menu ul li ul li a
{
	font-family: 'Arial';
	font-size: 13px;
	color: #FFFFFF;
}

.Menu ul li ul li a:hover
{
	font-family: 'Arial';
	font-size: 13px;
	color: #FFFFFF;
	font-weight: bold;
}

Open in new window


my aspx page

 
<asp:Menu ID="Menu" runat="server" Orientation="Horizontal" CssSelectorClass="Menu">
                                    <Items>
                                        <asp:MenuItem Text="HOME" Value="HOME" NavigateUrl="~/Default.aspx"></asp:MenuItem>
                                        <asp:MenuItem Text="SERVICES" Value="SERVICES">
                                            <asp:MenuItem Text="&#8226; Contract Management" Value="Contract Management" NavigateUrl="~/ContractManagement.aspx"></asp:MenuItem>
                                            <asp:MenuItem Text="&#8226; Construction Management" Value="Construction Management" NavigateUrl="~/ConstructionManagement.aspx"></asp:MenuItem>
                                            <asp:MenuItem Text="&#8226; Contract Administration" Value="Contract Administration" NavigateUrl="~/ContractAdministration.aspx"></asp:MenuItem>
                                            <asp:MenuItem Text="&#8226; Engineering Solutions" Value="Engineering Solutions" NavigateUrl="~/EngineeringSolutions.aspx"></asp:MenuItem>
                                            <asp:MenuItem Text="&#8226; EPCM Solutions" Value="EPCM Solutions" NavigateUrl="~/EPCMSolutions.aspx"></asp:MenuItem>
                                            <asp:MenuItem Text="&#8226; Implementing Agents" Value="Implementing Agents" NavigateUrl="~/ImplementingAgents.aspx"></asp:MenuItem>
                                            <asp:MenuItem Text="&#8226; Project Development" Value="Project Development" NavigateUrl="~/ProjectDevelopment.aspx"></asp:MenuItem>
                                        </asp:MenuItem>
                                        <asp:MenuItem Text="PROJECTS" Value="PROJECTS" NavigateUrl="~/Projects.aspx"></asp:MenuItem>
                                        <asp:MenuItem Text="DIRECTORS" Value="DIRECTORS" NavigateUrl="~/Directors.aspx">
                                        </asp:MenuItem>
                                        <asp:MenuItem Text="CONTACT US" Value="CONTACT US" NavigateUrl="~/Contacts.aspx">
                                        </asp:MenuItem>
                                    </Items>
                                </asp:Menu>

Open in new window


all i want is when i hover over the service the background to go red and the font to go white, and also when i hover over the sub menu of service the background colour red and font white.

can it be done?

i will post a image of how i want it to look, the problem is that my a:hover is turning the font red.

 menu to be
0
Comment
Question by:JCWEBHOST
  • 6
  • 5
11 Comments
 

Author Comment

by:JCWEBHOST
ID: 36535924
url to view:

URL
0
 
LVL 30

Expert Comment

by:LZ1
ID: 36536117
It looks like the text is white and the background is red on hover. When I hovered it just bolded the text.
0
 

Author Comment

by:JCWEBHOST
ID: 36536142
i have pasted this code but i never host it live

 
.Menu .AspNet-Menu-WithChildren
{
}

.Menu .AspNet-Menu-WithChildren a:hover
{
	color: #FFFFFF;
	background-color: #ed1f24;
}

Open in new window



problem is when i hover over the child node exsample project management the css for

.Menu .AspNet-Menu-WithChildren a:hover

do not work
0
 
LVL 30

Expert Comment

by:LZ1
ID: 36536158
Can you view the source of the menu and paste the rendered HTML?
The class you have .Menu .AspNet-Menu-WithChildren is not correct, as this is the code that produces the menu, not what is rendered.
0
 

Author Comment

by:JCWEBHOST
ID: 36536198
rendered HTML how do i c that?
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 30

Expert Comment

by:LZ1
ID: 36536209
When your looking at it in your browser, just view source.
0
 

Author Comment

by:JCWEBHOST
ID: 36536219
i will host it live

check it out

url
0
 
LVL 30

Expert Comment

by:LZ1
ID: 36536231
Your CSS is working fine. From the link you just provided everything looks good.
0
 

Author Comment

by:JCWEBHOST
ID: 36536250
but when i hover on the sub nodes it goes away
0
 
LVL 30

Accepted Solution

by:
LZ1 earned 500 total points
ID: 36536446
OH, I see what your talking about now.  I'm very sorry, I misunderstood you.  

Try adding this to your StyleSheet.css
.Menu ul li a:hover, ul.AspNet-Menu li.aspNet-Menu-WithChildren a, ul.AspNet-Menu li:hover {
    color: #FFF;
    background: #ED1F24;
}

Open in new window

0
 

Author Closing Comment

by:JCWEBHOST
ID: 36548369
Thanks
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

So you have coded your own WordPress plugin and now you want to allow users to upload images to a folder in the plugin folder rather than the default media location? Follow along and this article will show you how to do just that!
CSS is a visual language used to classify objects and define rules about how they should be displayed. CSS skills aren’t restricted to developers anymore, there is a big benefit to having a basic understanding of the language, regardless of your occ…
In this tutorial viewers will learn how to embed custom externally-hosted Google Fonts using the Google Font API in CSS Go to the Google Fonts website at google.com/fonts: Browse or search based on font properties or name to find a suitable font for…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now