[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Css Drop Down Menu

Posted on 2013-01-18
7
Medium Priority
?
664 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
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 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…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

656 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