?
Solved

Css Drop Down Menu

Posted on 2013-01-18
7
Medium Priority
?
662 Views
Last Modified: 2013-01-18
Hi experts,

I'm trying to use a css drop down menu into my website.

Here are the source : Css3 Drop Down Menu .

Here are my troubles :
- the 4th last menu, start at "products", marked with the class "menu_right" ; must be aligned at the left of the container (<ul>) but it don't work.
- the top menus marked with class "drop" don't work too : normally a small picture (an arrow - drop.png) must be showed at the right of the menu, to indicate that a submenu exists.

How it should be :
menu-prototype.tiff

How it is now:
 menu-now.tiff

Do you have an idea what's wrong ?

I have applied all the css & html code as follow :
- css : the same code as the final example except the width of the menu
#menu
{
	/*width: 940px;*/
	width: 90%;
}

Open in new window


- html :
<ul id="menu">
	<li> <!--- index group (Home) --->
		<cfinvoke returnvariable="variables.indexPages"		component="tools.pagesTools" method="getPages" group="index">
		<cfloop array="#variables.indexPages#" index="variables.page">
			<cfif variables.page.getPosition() NEQ 0>
				<cfset variables.pageName = uCase(variables.page.getTitle())>
				<cfoutput> <a class="navigationBarLink" href="#variables.page.getUrl()#" onclick="processing();">#variables.pageName#</a> </cfoutput>
			</cfif>
		</cfloop>
	</li>
		
	<li> <!--- company group (About Joe Cool) --->
		<a class="drop">ABOUT JOE COOL</a>
		<div class="dropdown_2columns">
			<cfinvoke returnvariable="variables.companyPages"	component="tools.pagesTools" method="getPages" group="company">
			<cfloop array="#variables.companyPages#" index="variables.page">
				<cfif variables.page.getPosition() NEQ 0>
					<cfset variables.pageName = uCase(variables.page.getTitle())>
					<div class="col_2">
						<cfoutput> <a class="navigationBarLink" href="#variables.page.getUrl()#" onclick="processing();">#variables.pageName#</a> </cfoutput>
						<hr />
					</div>
				</cfif>
			</cfloop>
		</div>
	</li>
		
	<li class="menu_right"> <!--- products group (Products) --->
		<a class="drop">PRODUCTS</a>
		<div class="dropdown_3columns"> <!--- align_right --->
			<cfinvoke returnvariable="variables.productsPages"	component="tools.pagesTools" method="getPages" group="products">
			<cfloop array="#variables.productsPages#" index="variables.page">
				<cfif variables.page.getPosition() NEQ 0>
					<cfset variables.pageName = uCase(variables.page.getTitle())>
					<div class="col_3">
						<cfoutput> <a class="navigationBarLink" href="#variables.page.getUrl()#" onclick="processing();">#variables.pageName#</a> </cfoutput>
						<hr />
					</div>
				</cfif>
			</cfloop>
		</div>
	</li>
		
	<li class="menu_right"> <!--- best sellers link --->
		<a class="navigationBarLink" href="/fashion/jewellery/Products.cfm?" onclick="processing();"> <cfoutput>BEST SELLERS</cfoutput> </a>
	</li>
		
	<li class="menu_right"> <!--- new items link --->
		<a class="navigationBarLink" href="/fashion/jewellery/Products.cfm?" onclick="processing();"> <cfoutput>NEW ITEMS</cfoutput> </a>
	</li>
		
	<li class="menu_right"> <!--- search box --->
		<a>
			<cfform action="/fashion/jewellery/search.cfm" method="post" id="navigationBarSearch" onsubmit="return validate();">
				<cfoutput> <cfset variables.searchLabel = ormExecuteQuery("from Page where page = 'Search' AND cfcName like '%_#session.language#'")> </cfoutput>
				<cfinput type="text" name="userSearch" maxlength="100" value="Enter keyword(s) here">
				<cfinvoke returnvariable="variables.javascript" component="javascripts.javascriptsTools" method="validateInput" controlName="userSearch" isRequired="true" 
								controlLabelValue="#variables.searchLabel[1].getTitle()#" maxLength="100" minLength="1" isAlphaNumericOnly="true">
				<cfoutput>#variables.javascript#</cfoutput>
				<cfinput type="submit" name="submitSearch" value="#variables.searchLabel[1].getTitle()#" onclick="processing();">
				<cfinput type="hidden" name="validate" value="search">
			</cfform>
		</a>
		
		<script type="text/javascript">
			function validate()
			{
				if(validate_userSearch())
				{
					return true;
				}
				return false;
			}
		</script>
	</li>
</ul>

Open in new window


I attach the both concerned files ("2_navigationBar.cfm" -> renamed in "2_navigationBar.cfm.txt" & "navigationBar.css")
I also attache a print screen of the look of my menu now (menu_now.tiff) & a prototype of how it should be (menu_prototype.tiff).

Well, the code is in html & coldfusion, but no matter, it works fine, just the css who does tricks to me :-)
The coldfusion code just retrieve the different page names.

Thanks a lot.
navigationBar.css
2-navigationBar.cfm.txt
0
Comment
Question by:adam1h
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 30

Expert Comment

by:LZ1
ID: 38793666
Anyway we can see a live link?
0
 

Author Comment

by:adam1h
ID: 38793727
Hi LZ1,

Yes, you could see it at Live view

Regards.
0
 
LVL 30

Accepted Solution

by:
LZ1 earned 2000 total points
ID: 38793740
First for the arrow issue:
This class should have some type of background image #menu li .drop.  Otherwise it won't show anything indicating a drop down.

Then the .menu_right class should have float:right;.  Did you copy the CSS exactly?
0
RHCE - Red Hat OpenStack Prep Course

This course will provide in-depth training so that students who currently hold the EX200 & EX210 certifications can sit for the EX310 exam. Students will learn how to deploy & manage a full Red Hat environment with Ceph block storage, & integrate Ceph into other OpenStack service

 

Author Comment

by:adam1h
ID: 38793844
Thanks for your comment.

Yes I have copied the css exactly, I just have changed the #menu width

I'll double check.
0
 

Author Comment

by:adam1h
ID: 38793894
The #menu li .drop class has a backgroung image :
#menu li .drop
{
	padding-right: 21px;
	background: url(/pictures/graphics/drop.png) no-repeat rightright 8px;
}
#menu li:hover .drop
{
	background: url(/pictures/graphics/drop.gif) no-repeat rightright 7px;
}

Open in new window

What do you mean exactly ?



The ..menu_right now runs well ; I have correct the code.
It was :
#menu .menu_right
{
	float: rightright;
	margin-right: 0px;
}

Open in new window


It is now :
#menu .menu_right
{
	float: right;
	margin-right: 0px;
}

Open in new window


Don't now why it was rightright.

Thanks for that.
0
 

Author Comment

by:adam1h
ID: 38793909
I have corrected other rightright, and now the arrow show good.

Thank you a thousand time for your precious help LZ1.
0
 
LVL 30

Expert Comment

by:LZ1
ID: 38794001
Glad to help
0

Featured Post

Understanding Linux Permissions

Linux for beginners: How to view the permissions associated with files and directories and also how you can change them.

Question has a verified solution.

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

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 …
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this tutorial viewers will learn how to customize the background color and font color of highlighted text using the ::selection element in CSS Begin by defining the selected text as an element in CSS by typing "::selection": Style the ::selection…
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
Suggested Courses

801 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