Styling a three-level unordered list - css

I have a 3-level deep, unordered list I'm styling to create a drop-down menu to extend this 2-level simple drop-down menu. The CSS is as follows:
#CHARSET "ISO-8859-1";
/* menu styles */
/* Top-level (Styles Works) */
#jsddm
{ margin: 0;
padding: 0}
#jsddm li
{ float: left;
list-style: none;
font: 12px Tahoma, Arial;}
#jsddm li a
{ display: block;
/*background: #324143; Old Style*/
background: -webkit-linear-gradient(top, rgba(238,238,238,1) 0%,rgba(204,204,204,1) 100%); /* Chrome10+,Safari5.1+ */;
padding: 5px 12px;
text-decoration: none;
border-right: 1px solid white;
width: 70px;
/*color: #EAFFED; Default color*/
color: #000099;
white-space: nowrap;}
#jsddm li a:hover
{ background: #24313C}
/* 2nd-level (Styles Works) */
#jsddm li ul
{ margin: 0;
padding: 0;
position: absolute;
visibility: visible;
border-top: 1px solid white}
#jsddm li ul li
{ float: none;
display: inline}
#jsddm li ul li a
{ width: auto;
background: #dfeffc;
color: #24313C}
#jsddm li ul li a:hover
{ background: #5c9ccc}
/* 3rd-level (Doesn't apply styles) */
#jsddm li ul li ul
{ margin: 0;
padding: 0;
position: absolute;
visibility: hidden;
border-top: 2px solid green}
The styling works for the first two levels, but not for the 3rd, I'm not sure if I have the syntax correct or if there's something else I'm missing. The html is as follows:
<div id="dropDownDiv">
<ul id="jsddm">
<li><a class="btn" href="#">Top Item 1</a>
<ul>
<li><a id="" class="btn" href="#">2nd Level Item 1</a></li>
<li>2nd Level Item 2</li>
</ul>
</li>
<li><a class="btn" href="#">Top Item 2</a>
<ul>
<li><a id="" class="btn hide" href="#">2nd Level Item 1</a></li>
<ul>
<li><a id="" class="btn hide" href="#">3rd Level Item 1</a></li>
<li><a id="" class="btn" href="#">3rd Level Item 1</a></li>
</ul>
<li><a id="" class="btn" href="#">2nd Level Item 1</a></li>
</ul>
</li>
</ul>
</div>
Any suggestions are appreciated.
UPDATE:
Thanks for loaning me your eyes Gareth. Corrected html:
<ul id="jsddm">
<li><a class="btn" href="#">Top Item 1</a>
<ul>
<li><a id="" class="btn" href="#">2nd Level Item 1</a></li>
<li>2nd Level Item 2</li>
</ul>
</li>
<li><a class="btn" href="#">Top Item 2</a>
<ul>
<li><a id="" class="btn hide" href="#">2nd Level Item 1</a>
<ul>
<li><a id="" class="btn hide" href="#">3rd Level Item 1</a></li>
<li><a id="" class="btn" href="#">3rd Level Item 1</a></li>
</ul>
</li>
<li><a id="" class="btn" href="#">2nd Level Item 1</a></li>
</ul>
</li>
</ul>

Your third level ul is not contained within an li. That might be causing your problem.

Related

Adding border around a menu box

I have html and css that does the fly out menu. Is it possible to put a border around the fly out box.
#WebPartWPQ4 {
width: 1040px!important;
//height: 200px!important;
overflow: hidden!important;
}
/*edit */
#WebPartWPQ6_ChromeTitle {
//width:50px!important;
position: absolute;
top: -40px;
z-index: 0;
}
#MSOZoneCell_WebPartWPQ6 {
position: absolute;
top: 500px
}
#cssmenu {
padding: 0;
margin: 0;
border: 0;
position: relative;
z-index: 1;
}
#cssmenu ul,
#cssmenu ul li,
#cssmenu ul ul,
#cssmenu ul ul ul {
list-style: none;
margin: 0;
padding: 0;
border: 0;
}
#cssmenu ul {
position: relative;
z-index: 397;
}
#cssmenu ul li {
min-height: 1px;
line-height: 1em;
vertical-align: middle;
}
#cssmenu ul li:hover {
position: relative;
//z-index: 99;
cursor: default;
}
#cssmenu ul ul {
visibility: hidden;
position: absolute;
top: 100%;
left: 0;
/* z-index: 398; */
width: 100%;
}
#cssmenu ul ul ul {
top: 0px;
left: 99%;
}
#cssmenu ul li:hover > ul {
visibility: visible;
width: 170px;
}
#cssmenu ul ul {
bottom: 0px;
left: 0;
}
/* Custom CSS Styles */
#cssmenu ul {
width: 100px;
}
#cssmenu ul ul {
width: 167px;
}
#cssmenu ul li {
padding: 7px 10px;
color: #000000;
//background-color: #F0F9FC;
background-color: #FFF;
//border: 1px solid red;
//border-bottom: 1px solid gray;
}
#cssmenu ul li:hover {
background: #cce5ff;
color: #000;
box-shadow: 1px 1px 10px 2px #888;
border-style: solid;
}
#cssmenu ul a:link,
#cssmenu ul a:visited {
color: #000;
text-decoration: none;
}
#cssmenu ul a:hover {
color: #000;
}
#cssmenu ul a:active {
color: #ffa500;
}
<div id='cssmenu'>
<ul>
<table cellpadding="1" cellspacing="1" style="width: 100%;">
<tbody>
<tr>
<td>
<li>
<img alt="Find" src="http://inside.colgate.in/_layouts/15/images/siteicons/Find.png" style="width: 150px; height: 150px;" />
<ul>
<li><a href='http://inside.colgate.in/sites/sales/Policies/Forms/RegionAll.aspx'><span>Policies/Forms</span></a>
</li>
<li><a href='http://inside.colgate.in/sites/sales/Policies/Forms/RegionCompanyWide.aspx'><span> - Company-wide</span></a>
</li>
<li><a href='http://inside.colgate.in/sites/sales/Policies/Forms/RegionCASpecial.aspx'><span> - CA Special</span></a>
</li>
<li><a href='http://inside.colgate.in/sites/sales/Policies/Forms/RegionSouthWestDeepWater.aspx'><span> - SouthWest Inboard</span></a>
</li>
<li><a href='http://inside.colgate.in/sites/sales/Policies/Forms/RegionSouthWestShelf.aspx'><span> - SouthWest Shelf</span></a>
</li>
<li><a href='http://inside.colgate.in/sites/sales/Policies/Forms/RegionLABasin.aspx'><span> - Basin</span></a>
</li>
<li><a href='http://inside.colgate.in/sites/sales/Policies/Forms/RegionSanJoaquinValley.aspx'><span> - Deep Valley</span></a>
</li>
<li><a href='http://www.google.com/world'><span>Safety Data Sheet (SDS)</span></a>
</li>
<li><a href='http://www.google.com/world'><span>Safety Alerts</span></a>
</li>
</ul>
</li>
</td>
<td>
<li>
<img alt="Report/Suggest" src="http://inside.colgate.in/_layouts/15/images/siteicons/ReportSuggest.png" style="width: 150px; height: 150px;" />
<ul>
<li><a href='http://www.google.com'><span>An Incident</span></a>
</li>
<li><a href='http://www.google.com'><span>An Emergency</span></a>
</li>
<li><a href='http://www.google.com'><span>An Observation</span></a>
</li>
<li><a href='http://www.google.com'><span>A Suggestion</span></a>
</li>
</ul>
</li>
</td>
<td>
<li>
<img alt="My Stuff" src="http://inside.colgate.in/_layouts/15/images/siteicons/MyStuff.png" style="width: 150px; height: 150px;" />
<ul>
<li><a href='http://www.google.com'><span>My Training</span></a>
</li>
<li><a href='http://www.google.com'><span>My PPE</span></a>
</li>
<li><a href='http://www.google.com'><span>My Safety Committee</span></a>
</li>
<li><a href='http://www.google.com'><span> - CA Special</span></a>
</li>
<li><a href='http://www.google.com'><span> - SouthWest Inboard</span></a>
</li>
<li><a href='http://www.google.com'><span> - LA Basin</span></a>
</li>
<li><a href='http://www.google.com'><span> - Valley</span></a>
</li>
<li><a href='http://www.google.com'><span>My Floor Wardens</span></a>
</li>
<li><a href='http://www.google.com'><span> - Cloverfield</span></a>
</li>
<li><a href='http://www.google.com'><span> - Oklahoma</span></a>
</li>
<li><a href='http://www.google.com'><span> - New York</span></a>
</li>
<li><a href='http://www.google.com'><span>Adjust My Workstation</span></a>
</li>
</ul>
</li>
</td>
<td>
<li>
<img alt="Emergency" src="http://inside.colgate.in/_layouts/15/images/siteicons/Emergency.png" style="width: 150px; height: 150px;" />
<ul>
<li><a href='http://www.google.com'><span>Emergency Numbers and Guides</span></a>
</li>
<li><a href='http://www.google.com'><span> - Cloverfield</span></a>
</li>
<li><a href='http://www.google.com'><span> - CA Special</span></a>
</li>
<li><a href='http://www.google.com'><span> - SouthWest Inboard</span></a>
</li>
<li><a href='http://www.google.com'><span> - SouthWest Shelf</span></a>
</li>
<li><a href='http://www.google.com'><span> - Oklahoma</span></a>
</li>
<li><a href='http://www.google.com'><span> - Orleans</span></a>
</li>
<li><a href='http://www.google.com'><span> - Basin</span></a>
</li>
<li><a href='http://www.google.com'><span> - New York</span></a>
</li>
<li><a href='http://www.google.com'><span> - Valley</span></a>
</li>
<li><a href='http://www.google.com'><span>Incident Management/ICS</span></a>
</li>
<li><a href='http://www.google.com'><span>Business Continuity</span></a>
</li>
<td>
<li>
<img alt="Contractors" src="http://inside.colgate.in/_layouts/15/images/siteicons/Contractors.png" style="width: 150px; height: 150px;" />
<ul>
<li><a href='http://www.google.com/world'><span>Contractor Portal</span></a>
</li>
<li><a href='http://www.google.com/world'><span>ISNetworld</span></a>
</li>
<li><a href='http://www.google.com/world'><span>Pocket Guidebook</span></a>
</li>
</ul>
</li>
</td>
<td>
<li>
<img alt="Get Info" src="http://inside.colgate.in/_layouts/15/images/siteicons/GetInfo.png" style="width: 150px; height: 150px;" />
<ul>
<li><a href='http://www.google.com'><span>Orientation Materials</span></a>
</li>
<li><a href='http://www.google.com/world'><span> - Company-wide</span></a>
</li>
<li><a href='http://www.google.com/world'><span> - CA Special</span></a>
</li>
<li><a href='http://www.google.com/world'><span> - SouthWest Inboard</span></a>
</li>
<li><a href='http://www.google.com/world'><span> - SouthWest Shelf</span></a>
</li>
<li><a href='http://www.google.com/world'><span> - Basin</span></a>
</li>
<li><a href='http://www.google.com/world'><span> - Valley</span></a>
</li>
<li><a href='http://www.google.com/world'><span>External Links</span></a>
</li>
<li><a href='http://www.google.com/world'><span>User Guides</span></a>
</li>
</ul>
</li>
</td>
</ul>
</li>
</td>
</tr>
</tbody>
</table>
</ul>
</div>
I tried this but it didnt help at ul li
border-style: solid;
Try this remove bottom: 0 from line 88 in the JSFiddle and add border.
/* at line 88 in JSFiddle change this */
#cssmenu ul ul {
bottom: 0;
left: 0;
}
/* to this */
#cssmenu ul ul {
border: 1px solid #ccc;
left: 0;
}
By setting bottom: 0 you're effectively telling your dropdown menu's ul to have a height of 0 and therefore the border only looks like it's applied to the top of the dropdown.

How to create an absolutely positioned submenu which appears on css hover

I have a menu which needs to expand to show the child elements on hover. According to the design the expanded child ul needs to expand across the full width of the page so needs to be absolutely positioned in order to break out from the width of the parent li.
The problem is that I need the child ul to remain visible as you hover over it. Because it is absolutely positioned it no longer contained by the parent li, so as soon as my mouse moves off that it disappears.
If I change the parent li to position:relative the ul remains visible when the mouse moves over it, but the child ul no longer fills 100% width of the page.
Here is a fiddle to demonstrate:
https://jsfiddle.net/sx2aouht/12/
Here is abbreviated markup (full code on the fiddle link above):
<nav class="priority-nav">
<ul class="menu">
<li class="first expanded active-trail active menu-mlid-178 help">Help & Advice
<ul class="menu">
<li class="first leaf menu-mlid-526">Find your local services</li>
<li class="leaf menu-mlid-528">Join CarerSmart</li>
<li class="leaf menu-mlid-527">Join our online community</li>
</ul>
</li>
</ul>
</nav>
Here is the css:
.priority-nav ul li {
//if this is uncommented the ul will remain visible when
//the mouse is over it, but the ul will not fill the page 100%
//position: relative;
float: left;
padding: 0 10px;
list-style-type: none;
}
.priority-nav ul li ul {
display: none;
position: absolute;
top: 40px;
left: 0;
background-color: red;
width: 100%;
padding: 50px 130px;
}
.priority-nav ul li:hover ul {
display: block;
}
The menu already stays open when you hover the submenu, the problem is that when the mouse goes down to the submenu, it leaves the hovered li element, in order to avoid this make sure that when the mouse enters the submenu, it will not leave the main li you hover, the submenu is in the li item, so hovering it is considered hovering the main li.
You just have to avoid leaving the main li until you enter the submenu, I used some padding in your example:
.priority-nav ul li {
//if this is uncommented the ul will remain visible when
//the mouse is over it, but the ul will not fill the page 100%
//position: relative;
float: left;
padding: 0 10px 5px;
list-style-type: none;
}
.priority-nav ul li ul {
display: none;
position: absolute;
top: 35px;
left: 0;
background-color: red;
width: 100%;
padding: 50px 130px;
}
.priority-nav ul li:hover ul {
display: block;
}
<nav class="priority-nav">
<ul class="menu"><li class="first expanded active-trail active menu-mlid-178 help">Help & Advice<ul class="menu"><li class="first leaf menu-mlid-526">Find your local services</li>
<li class="leaf menu-mlid-528">Join CarerSmart</li>
<li class="leaf menu-mlid-527">Join our online community</li>
<li class="leaf menu-mlid-530">Help and advice topic 4</li>
<li class="leaf menu-mlid-531">Help and advice topic 5</li>
<li class="leaf menu-mlid-532">Help and advice topic 6</li>
<li class="leaf menu-mlid-533">Help and advice topic 7</li>
<li class="leaf menu-mlid-534">Help and advice topic 8</li>
<li class="last leaf menu-mlid-535">Help and advice topic 9</li>
</ul></li>
<li class="expanded menu-mlid-184 community">Online Community<ul class="menu"><li class="first leaf menu-mlid-536">Discussion board</li>
<li class="last leaf menu-mlid-537">Chat</li>
</ul></li>
<li class="last expanded menu-mlid-176 get-involved">Get Involved<ul class="menu"><li class="first leaf menu-mlid-529">Donate</li>
<li class="leaf menu-mlid-538">Events</li>
<li class="leaf menu-mlid-539">Volunteer</li>
<li class="last leaf menu-mlid-540">Corporate opportunities</li>
</ul></li>
<li class="more"><span>More</span></li>
</ul>
</nav>
If the submenu is to be 100% width of the page but the top-level menu is not then we can still position the submenu in relation to the parent menu and not the li.
.priority-nav >.menu {
position: relative;
}
But we size the submenu to the width of the page with viewport units.
.priority-nav ul li ul {
display: none;
position: absolute;
top:100%;
left: 0;
background-color: red;
width: 100vw;
}
* {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
margin: 0;
padding: 0;
}
.cf:before,
.cf:after {
content: " ";
display: table;
/* clearfix */
}
.cf:after {
clear: both;
}
.priority-nav {
position: relative;
width: 70%;
}
.priority-nav > .menu {
background: #c0ffee;
}
.priority-nav ul li {
float: left;
padding: 0 10px;
list-style-type: none;
padding: 10px;
}
.priority-nav ul li ul {
display: none;
position: absolute;
top: 100%;
left: 0;
background-color: red;
width: 100vw;
}
.priority-nav ul li:hover ul {
display: block;
}
<nav class="priority-nav">
<ul class="menu cf">
<li class="first expanded active-trail active menu-mlid-178 help">Help & Advice
<ul class="menu">
<li class="first leaf menu-mlid-526">Find your local services
</li>
<li class="leaf menu-mlid-528">Join CarerSmart
</li>
<li class="leaf menu-mlid-527">Join our online community
</li>
<li class="leaf menu-mlid-530">Help and advice topic 4
</li>
<li class="leaf menu-mlid-531">Help and advice topic 5
</li>
<li class="leaf menu-mlid-532">Help and advice topic 6
</li>
<li class="leaf menu-mlid-533">Help and advice topic 7
</li>
<li class="leaf menu-mlid-534">Help and advice topic 8
</li>
<li class="last leaf menu-mlid-535">Help and advice topic 9
</li>
</ul>
</li>
<li class="expanded menu-mlid-184 community">Online Community
<ul class="menu">
<li class="first leaf menu-mlid-536">Discussion board
</li>
<li class="last leaf menu-mlid-537">Chat
</li>
</ul>
</li>
<li class="last expanded menu-mlid-176 get-involved">Get Involved
<ul class="menu">
<li class="first leaf menu-mlid-529">Donate
</li>
<li class="leaf menu-mlid-538">Events
</li>
<li class="leaf menu-mlid-539">Volunteer
</li>
<li class="last leaf menu-mlid-540">Corporate opportunities
</li>
</ul>
</li>
<li class="more"><span>More</span>
</li>
</ul>
</nav>

How to make this menu occupy all the remaining space's width?

There is a menu :
<div id="divmenuppal"> // this the menu
<ul class="dropdown">
<li class="menuppal">Administration
<ul>
<li>Artificial Turf</li>
<li>
Batting Cages
<ul>
<li>Indoor
<ul>
<li>Garden</li>
</ul>
</li>
<li>Outdoor</li>
</ul>
</li>
<li>Benches & Bleachers</li>
<li>Communication Devices</li>
<li>Dugouts</li>
<li>Fencing & Windscreen</li>
<li><hr></li>
<li>Floor Protectors</li>
<li>Foul Poles</li>
<li>Netting</li>
<li>Outdoor Furniture</li>
<li>Outdoor Signs</li>
<li><hr></li>
<li>Padding</li>
<li>Scoreboards</li>
<li>Shade Structures</li>
<li> - VIEW ALL - </li>
</ul>
</li>
<li class="menuppal">Structure
<ul>
<li>All-in-One Team Cart</li>
<li>Air & Electrical Reels</li>
<li>Field Drags</li>
<li>
Field Marking Equipment
<ul>
<li>Batter's Box Templates</li>
<li>Dryline Markers</li>
<li>Field Paint
<ul>
<li>Garden</li>
</ul>
</li>
<li>Field Sprayers</li>
<li>Stencils</li>
</ul>
</li>
<li>
Field Tarps
<ul>
<li>Area Tarps</li>
<li>Growth Covers / Protectors</li>
<li>Infield Tarps</li>
<li>Tarp Accessories</li>
</ul>
</li>
<li>Hand Tools</li>
<li>
Irrigation, Hoses, Nozzles
<ul>
<li>Hoses & Hose Reels</li>
<li>Irrigation</li>
<li>Nozzles</li>
</ul>
</li>
<li>Layout Tools</li>
<li>Moisture Removal</li>
<li><hr></li>
<li>Mound Fortification</li>
<li>Mowers & Stripers</li>
<li>Soil Management</li>
<li>Soil Amendments</li>
<li>Spreaders & Sweepers</li>
<li> - VIEW ALL - </li>
</ul>
</li>
<li class="menuppal">Exercice
<ul>
<li>
Baseball - Softball
<ul>
<li>Base Accessories</li>
<li>Bases & Home Plates</li>
<li>Game Accessories</li>
<li>Pitching Rubbers</li>
</ul>
</li>
<li>
Batting Practice Equipment
<ul>
<li>Backstops</li>
<li>Infield Screens</li>
<li>Jugs Pitching Machines</li>
<li>Turf Mats</li>
<li>Turf Protectors</li>
<li>Replacement Accessories</li>
</ul>
</li>
<li>
Batting Cages
<ul>
<li>Indoor</li>
<li>Outdoor</li>
</ul>
</li>
<li>
Portable Mounds
<ul>
<li>Batting Practice Mounds</li>
<li>Game Mounds</li>
<li>Practice Mounds</li>
</ul>
</li>
<li>
Football
<ul>
<li>First Down Markers</li>
<li>Football Accessories</li>
<li>Football Goalposts</li>
</ul>
</li>
<li>
Soccer
<ul>
<li>Soccer Goals</li>
<li>Soccer Accessories</li>
</ul>
</li>
<li> - VIEW ALL - </li>
</ul>
</li>
<li class="menuppal">Contribuables et biens
<ul>
<li>Ladders & Sticks</li>
<li>Hurdles</li>
<li>Training Accessories</li>
<li>Smart-Cart Training System</li>
<li>Smart-Hurdle Collection</li>
<li> - VIEW ALL - </li>
</ul>
</li>
<li class="menuppal">Recettes
<ul>
<li>Field Design</li>
<li>Turf Management</li>
<li>Training</li>
<li> - VIEW ALL - </li>
</ul>
</li>
<li class="menuppal">Edition
<ul>
<li>Field Design</li>
<li>Turf Management</li>
<li>Training</li>
<li> - VIEW ALL - </li>
</ul>
</li>
<li class="menuppal">Outils
<ul>
<li>Field Design</li>
<li>Turf Management</li>
<li>Training</li>
<li> - VIEW ALL - </li>
</ul>
</li>
</ul>
</div>
<div class="breadcrumbs" style="clear:left;"> // this is the breadcrumbs
<div class="container-fluid">
<ul class="bread">
<li>Accueil</li><li>Gestion des contribuables</li><li><a>Fiche d'un contribuable</a></li>
</ul>
<ul class="bread pull-right">
<li style="color: #000;padding: 5px;font-size: 11px;font-weight: bold;">Fiche d'un contribuable</li>
</ul>
</div>
</div>
The css of the menu :
* {
margin: 0;
padding: 0;
}
body {
font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
}
a {
text-decoration: none;
font-size: 11px;
font-weight: 100;
width: 100%;
box-sizing: border-box;
}
ul {
list-style: none;
}
ul.dropdown ul {
width: 220px;
visibility: hidden;
position: absolute;
background-color: #40617C;
}
ul.dropdown li:not(.menuppal):not(:first-child):not(:last-child)
{
margin-top: 8px;
margin-bottom: 8px;
}
hr {
margin-left: 6px;
margin-right: 8px;
border-top: 0;
}
/*
LEVEL ONE : MAIN MENU
*/
ul.dropdown {
position: relative;
}
ul.dropdown li.menuppal {
float: left;
zoom: 1;
background: #000 url(../images/menuLight.png) repeat-x top left;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-left: 1px solid #222;
}
ul.dropdown li.menuppal a {
display: block;
padding: 4px 8px;
color: #000000;
}
/* Doesn't work in IE */
ul.dropdown li.menuppal:hover {
background: #ccc url('../images/menuDark.png') repeat-x 50% 50%;
position: relative;
}
/*
FIN LEVEL ONE
*/
/*
LEVEL TWO
*/
ul.dropdown ul {
top: 100%;
left: 0;
}
ul.dropdown ul li {
float: none;
position: relative;
}
/* IE 6 & 7 Needs Inline Block */
ul.dropdown li.menuppal ul li a {
border-right: none;
color: #FFF;
display: inline-block;
}
ul.dropdown li.menuppal ul li a:hover {
background: #07243a;
}
ul.dropdown li.menuppal ul li a:visited {
word-break: break-all;
}
/*
LEVEL THREE
*/
ul.dropdown ul ul {
left: 100%;
top:0!important;
}
/*
LEVEL FOUR
*/
ul.dropdown ul ul ul {
left: 100%;
top:0!important;
}
ul.dropdown li:hover > ul {
visibility: visible;
}
At runtime the menu is not occupying all the horizontal space :
So how to make the menu fill the remaining space like in this image :
ul.dropdown {
background: #000 url(../images/menuLight.png) repeat-x top left;
}
Use flex layout. I add following code to the bottom of your CSS and it did the trick:
#divmenuppal > .dropdown {
display: flex;
}
.dropdown .menuppal:last-child {
flex-grow: 1;
}
http://jsfiddle.net/w2n79nsy/
ok I found it from #SunilDalal's answer :
ul.dropdown {
position: relative;
float: left;
width: 100%;
background: #000 url('menuLight.png') repeat-x top left;
}

Button style in top bar in Foundation?

Is it possible in Zurb Foundation to have a normal button in the top bar menu items? Here is an example:
The black button is what I'm trying to accomplish.
Here is what the HTML currently looks like:
<div class="contain-to-grid">
<nav class="top-bar" data-topbar="" role="navigation">
<ul class="title-area">
<li class="name">
<h1>
SiteName
</h1>
</li>
<li class="toggle-topbar menu-icon">
<span>Menu</span>
</li>
</ul>
<section class="top-bar-section">
<ul class="left">
<li>
Nav item
</li>
<li>
Nav item
</li>
<li>
Nav item (Should be button)
</li>
</ul>
</section></nav>
</div>
Sure, just use class button inside a has-form list item.
<li class="has-form">
<a class="button">Button</a>
</li>
Demo: http://codeply.com/go/00cVHQ15Px
Try like this, may be?
* {font-family: Segoe UI;}
nav ul,
nav ul li {margin: 0; padding: 0; list-style: none; background: #99f; overflow: hidden; display: inline-block;}
nav ul li a {text-decoration: none; display: block; width: 100px; margin: 10px; padding: 5px 10px;}
nav ul li a.btn {background: #333; color: #fff; text-align: center; border-radius: 3px;}
<nav>
<ul>
<li>New Button</li>
<li><a class="btn" href="#">New Button</a></li>
<li>New Button</li>
</ul>
</nav>

Right aligning last nav menu pop up with CSS

I'm looking to right align the "pop-up" menu of my nav structure to the right edge of the div. Currently, it is "popping out" of the div. Any suggestions on how to accomplish this?
.main-navigation {
background-color: #2f9fa8;
}
.subMenu li:hover > a {
color: #e3d174;
text-decoration: underline;
}
#GeneralInfo {
width: 160px;
padding-top: 5px;
padding-left: 20px;
}
#Registration {
width: 200px;
padding-top: 5px;
padding-left: 20px;
}
#ScientificPrograms {
width: 175px;
padding-top: 5px;
padding-left: 20px;
}
#SpecialEvents {
width: 110px;
padding-top: 5px;
padding-left: 20px;
}
#Careers {
width: 70px;
padding-top: 5px;
padding-left: 20px;
}
#Exhibits {
width: 90px;
padding-top: 5px;
padding-left: 20px;
}
.subMenu {
width: 200px;
}
#navMenu ul,
#navMenu {
list-style-type: none;
margin: 0;
padding: 0;
}
.nav > li > a {
display: block;
height: 100%;
color: #FFFFFF;
text-decoration: none;
padding: 0;
font-size: 14px;
font-weight: 800;
outline: none;
}
.nav > li > a:hover {
display: block;
height: 100%;
padding: 0;
color: #FFFFFF;
text-decoration: none;
background: #2f9fa8;
}
.nav > li {
padding: 0;
float: left;
height: 30px;
font-family: Arial, sans-serif;
font-size: 14px;
background-color: #2f9fa8;
}
.nav li {
position: relative;
}
.nav li > ul {
position: absolute;
display: none;
border-bottom: 0;
z-index: 9999;
}
.nav li > ul > li > a {
text-decoration: none;
color: #FFFFFF;
font-weight: 600;
display: block;
background: #2f9fa8;
text-shadow: none;
padding: 5px 3px 5px 10px;
text-indent: -7px;
}
.nav li:hover > ul {
display: block;
}
<nav class="main-navigation">
<ul id="navMenu" class="nav">
<li id="GeneralInfo"><a class="gradient" href="#">General Information</a>
<ul class="subMenu" id="sub-GeneralInfo">
<li><a href='#'>Annual Meeting</a>
</li>
<li><a href='#'>San Diego, CA</a>
</li>
<li><a href='#'>Supporters</a>
</li>
<li><a href='#'>Just for the Media</a>
</li>
<li><a href='#'>Volunteer</a>
</li>
<li><a href='#'>Awards and Fellowships</a>
</li>
<li><a href='#'>FAQs</a>
</li>
<li><a href='#'>Forms</a>
</li>
<li><a href='#'>Events and Maps</a>
</li>
<li><a href='#'>Meeting Requests</a>
</li>
<li><a href='#'>Visa Information</a>
</li>
<li><a href='#'>Transportation</a>
</li>
<li><a href='#'>Ride Share Program</a>
</li>
<li><a href='#'>Restaurants</a>
</li>
<li class='last'><a href='#'>Top Reasons to Attend</a>
</li>
</ul>
</li>
<li id="Registration"><a class="gradient" href="#">Registration & Housing</a>
<ul class="subMenu" id="sub-Registration">
<li><a href='#'>Online Registration</a>
</li>
<li><a href='#'>Registration Information</a>
</li>
<li><a href='#'>Housing Reservations</a>
</li>
<li class='last'><a href='#'>Room Share Program</a>
</li>
</ul>
</li>
<li id="ScientificPrograms"><a class="gradient" href="#">Scientific Programs</a>
<ul class="subMenu" id="sub-ScientificPrograms">
<!--<li><a href='#'>Submit a Session Proposal</a></li>-->
<li><a href='#'>Submit an Abstract</a>
</li>
<li><a href='#'>Mobile Event App</a>
</li>
<!--<li><a href='#'>Scientific Session Index</a></li>-->
<!--<li><a href='#'>Abstract Author Index</a></li>-->
<!--<li><a href='#'>Abstract Keyword Index</a></li>-->
<li><a href='#'>Continuing Education</a>
</li>
<li><a href='#'>Continuing Medical Education</a>
</li>
<li><a href='#'>Scientific Sessions</a>
</li>
<li><a href='#'>Thematic Approach</a>
</li>
<!--<li><a href='#'>Scientific ePosters</a></li>-->
<li class='last'><a href='#'>Presentation Instructions</a>
</li>
</ul>
</li>
<li id="SpecialEvents"><a class="gradient" href="#">Special Events</a>
<ul class="subMenu" id="sub-SpecialEvents">
<li><a href='#'>Outreach</a>
</li>
<li><a href='#'>Featured Sessions</a>
</li>
<li><a href='#'>Social Events</a>
</li>
<li><a href='#'>Student and Postdoc Scholar Events</a>
</li>
<li><a href='#'>Satellite Meetings</a>
</li>
<li><a href='#'>Meeting Requests</a>
</li>
<li class='last'><a href='#'>Virtual Global Gallery Posters</a>
</li>
</ul>
</li>
<li id="Careers"><a class="gradient" href="#">Careers</a>
<ul class="subMenu" id="sub-Careers">
<li><a href='#'>Career Sessions</a>
</li>
<li><a href='#'>Career Resources and Development Services</a>
</li>
<li class='last'><a href='#'>Job Bank</a>
</li>
</ul>
</li>
<li id="Exhibits"><a class="gradient" href="#">Exhibits</a>
<ul class="subMenu" id="sub-Exhibits">
<li><a href='#'>ToxExpo</a>
</li>
<li><a href='#'>Exhibitor Listing</a>
</li>
<li><a href='#'>Exhibitor-Hosted Session Application</a>
</li>
<li><a href='#'>Exhibitor-Hosted Sessions</a>
</li>
<li><a href='#'>Support Opportunities</a>
</li>
<li class='last'><a href='#'>Supporter Listing</a>
</li>
</ul>
</li>
</ul>
</nav>
You can fint it also in codepen
If you are looking to right align the popup menu .nav li ul to the container "trigger" menu element then you should simply add right: 0; to .nav li > ul
Like:
.nav li > ul {
position: absolute;
display: none;
border-bottom: 0;
right: 0;
z-index: 9999;
}

Resources