Solved

css

Posted on 2011-09-14
2
279 Views
Last Modified: 2012-05-12
Hey guys a have a menu and want it to look like the iamge below. I have wrote the css code but the service link not working out.

i want to hover over the menu a just turn the colour of the font red but when i hover over the service the background colour must be red and font white and also the sub menu of service when i hover to maintain the red background and white font. please help..

 css
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;
	padding-right: 15px;
	padding-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-WithChildren
{
}

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

.Menu .AspNet-Menu-WithChildren
{

}

.Menu ul li ul
{
	width: auto;
	background-color: #ed1f24;
	margin-left: -15px;
}

.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


aspx code
 
<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


page source
 
<div class="Menu" id="ctl00_Menu">

	<div class="AspNet-Menu-Horizontal">

			<ul class="AspNet-Menu">

				<li class="AspNet-Menu-Leaf  AspNet-Menu-Selected">

					<a href="Default.aspx" class="AspNet-Menu-Link  AspNet-Menu-Selected">

						HOME</a>

				</li>

				<li class="AspNet-Menu-WithChildren">

					<a href="javascript:__doPostBack('ctl00$Menu','bSERVICES')" class="AspNet-Menu-Link">

						SERVICES</a>

					<ul>

						<li class="AspNet-Menu-Leaf">

							<a href="ContractManagement.aspx" class="AspNet-Menu-Link">

								• Contract Management</a>

						</li>

						<li class="AspNet-Menu-Leaf">

							<a href="ConstructionManagement.aspx" class="AspNet-Menu-Link">

								• Construction Management</a>

						</li>

						<li class="AspNet-Menu-Leaf">

							<a href="ContractAdministration.aspx" class="AspNet-Menu-Link">

								• Contract Administration</a>

						</li>

						<li class="AspNet-Menu-Leaf">

							<a href="EngineeringSolutions.aspx" class="AspNet-Menu-Link">

								• Engineering Solutions</a>

						</li>

						<li class="AspNet-Menu-Leaf">

							<a href="EPCMSolutions.aspx" class="AspNet-Menu-Link">

								• EPCM Solutions</a>

						</li>

						<li class="AspNet-Menu-Leaf">

							<a href="ImplementingAgents.aspx" class="AspNet-Menu-Link">

								• Implementing Agents</a>

						</li>

						<li class="AspNet-Menu-Leaf">

							<a href="ProjectDevelopment.aspx" class="AspNet-Menu-Link">

								• Project Development</a>

						</li>

					</ul>

				</li>

				<li class="AspNet-Menu-Leaf">

					<a href="Projects.aspx" class="AspNet-Menu-Link">

						PROJECTS</a>

				</li>

				<li class="AspNet-Menu-Leaf">

					<a href="Directors.aspx" class="AspNet-Menu-Link">

						DIRECTORS</a>

				</li>

				<li class="AspNet-Menu-Leaf">

					<a href="Contacts.aspx" class="AspNet-Menu-Link">

						CONTACT US</a>

				</li>

			</ul>



	</div>

Open in new window

0
Comment
Question by:JCWEBHOST
2 Comments
 
LVL 10

Accepted Solution

by:
jtwcs earned 500 total points
ID: 36545709
Try this for the menu css.

 
.Menu {
    background-color: #FFFFFF;
    margin-left: 0;
}
.Menu ul li {
    font-family: 'Century Gothic';
    font-size: 15px;
    font-weight: normal;
    height: 34px;
    line-height: 34px;
}
.Menu ul li a {
    color: #272974;
    padding: 0 15px;
}
.Menu ul li:hover, .Menu ul li:hover a {
    background: #ED1F24;
    color: white;
}
.Menu .AspNet-Menu-Selected {
    color: #ED1F24;
    font-weight: bold;
}
.Menu .AspNet-Menu-ChildSelected {
    color: #ED1F24;
}
.Menu .AspNet-Menu-WithChildren {
}
.Menu ul li ul {
    background-color: #ED1F24;
    width: auto;
}
.Menu ul li ul li {
    display: block;
    line-height: 25px;
    margin: 0;
    padding: 0 10px 0 0;
    white-space: nowrap;
    width: 187px;
    z-index: 2;
}
.Menu ul li ul li a {
    color: #FFFFFF;
    font-family: 'Arial';
    font-size: 13px;
}
.Menu ul li ul li a:hover {
    color: #FFFFFF;
    font-family: 'Arial';
    font-size: 13px;
    font-weight: bold;
}

Open in new window

0
 

Author Closing Comment

by:JCWEBHOST
ID: 36548543
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

Suggested Solutions

Title # Comments Views Activity
Centering Vertically 3 28
SQL Login 17 40
How to make interactive HTML code pages like w3school or Codecademy? 3 29
Code works but it's slow 24 42
Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

920 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

12 Experts available now in Live!

Get 1:1 Help Now