UL list items stacking from the bottom instead of top - html

I have an ul that isn't stacking properly (or is, but not to my desired outcome.)
http://jsfiddle.net/rrrpy1rk/
html:
<ul id="footer_site_map">
<li class="footer_parent">About
<ul class="footer_of_children">
<li class="footer_children">Our Veterinarians
</li>
<li class="footer_children">Our Staff
</li>
</ul>
</li>
<li class="footer_parent">Preventative Medicine
<ul class="footer_of_children">
<li class="footer_children">Puppies
</li>
<li class="footer_children">Kittens
</li>
<li class="footer_children">Adult Care
</li>
<li class="footer_children">Senior Care
</li>
<li class="footer_children">Rabbits
</li>
</ul>
</li>
<li class="footer_parent">Surgical
<ul class="footer_of_children">
<li class="footer_children">Spaying
</li>
<li class="footer_children">Neutering
</li>
<li class="footer_children">Orthopedic Surgery
</li>
<li class="footer_children">Soft Tissue Surgery
</li>
<li class="footer_children">Declawing Cat
</li>
</ul>
</li>
<li class="footer_parent">Medical
<ul class="footer_of_children">
<li class="footer_children"> Complete Medical Assessment
</li>
<li class="footer_children">Cardiology
</li>
<li class="footer_children">Flea Treatment
</li>
<li class="footer_children">Dentistry
</li>
<li class="footer_children">Radiology
</li>
<li class="footer_children">Laboratory
</li>
</ul>
</li>
</ul>
CSS:
#footer_site_map {
position:absolute;
padding:0;
margin:0;
top: 20px;
left: 0;
width:100%;
}
.footer_parent {
position: relative;
width: 180px;
height:20px;
padding: 0 5px;
display: inline-block;
}
.footer_parent a {
color: #FFF;
text-decoration: none;
font-family: MyriadProSemibold;
font-size: 120%;
}
.footer_children {
padding: 5px 0;
width: 200px;
}
.footer_children a {
color: #FFF;
list-style-type: none;
text-decoration: none;
font-family: ralewayregular !important;
font-size: 100%;
}
.footer_of_children {
padding: 0;
margin:0;
}
As seen from the fiddle the parent ul li's are stacking on top of the children ul li's. I need it to go the other way around.
Is there some easy fix, or should I re-structure it.
If you look at the fiddle, you may need to drag the bar to increase the size of the Result.

Addding vertical-align: top; to your .footer_parent fixes the issue:
.footer_parent {
position: relative;
width: 180px;
height: 20px;
padding: 0 5px;
display: inline-block;
vertical-align: top;
}

Related

how to stretch a UL across the browser window

I have an UL that acts as my navigation bar on my web page. currently it is all the way to the left of the screen. I would like it to be centered and have the background color stretch all the way to the left and right, Like below. what would I need to change to stretch the UL across the page like the top example image?
Here is what it looks like currently:
Here is my code:
.parent {
display: block;
position: relative;
float: left;
line-height: 30px;
background-color: #1D3567;
}
.parent a {
margin: 10px;
color: #FFFFFF;
text-decoration: none;
}
.parent:hover>ul {
display: block;
position: absolute;
}
.child {
display: none;
}
.child li {
background-color: #1D3567;
line-height: 30px;
border-bottom: #CCC 1px solid;
border-right: #CCC 1px solid;
width: 100%;
}
.child li a {
color: #FFFFFF;
}
ul {
list-style-type: none;
margin: 0;
padding: 0px;
min-width: 15em;
}
ul ul ul {
left: 100%;
top: 0;
margin-left: 1px;
}
li:hover {
background-color: #95B4CA;
}
.parent li:hover {
background-color: #95B4CA;
}
<ul id="nav_ul">
<li class="parent">Home</li>
<li class="parent">Outlook Web</li>
<li class="parent">Production
<ul class="child">
<li class="parent">Hennig South</li>
<li class="parent">Hennig Enclosure Systems</li>
<li class="parent">Hennig South</li>
<li class="parent">Factory Andon</li>
<li class="parent">Web Docs</li>
</ul>
</li>
<li class="parent">IT
<ul class="child">
<li>Knowledge Base</li>
<li>Submit a Ticket</li>
<li class="parent">Archived Links</li>
</ul>
</li>
<li class="parent">Office Directories
<ul class="child">
<li>Hennig</li>
<li>AME</li>
</ul>
</li>
<li class="parent">Hennig Parts</li>
<li class="parent">Factory Andon</li>
<li class="parent">Business Cards</li>
<li class="parent">Reports
<ul class="child">
<li class="parent">Global Shop<span class="expand">»</span>
<ul class="child">
<li>Inventory Report</li>
<li>Sales Report</li>
<li>Quotes Report</li>
<li>Work Order Report</li>
<li>Part Where Used Report</li>
</ul>
</li>
<li class="parent">Ndustrios<span class="expand">»</span>
</li>
</ul>
</li>
</ul>
Make your ul a flex container in which you align the children centered, and apply the background-color to this element instead of the li children by adding this rule:
#nav_ul {
width: 100%;
display: flex;
justify-content: center;
background-color: #1D3567;
}
.parent {
position: relative;
float: left;
line-height: 30px;
background-color: #1D3567;
}
.parent a {
margin: 10px;
color: #FFFFFF;
text-decoration: none;
}
.parent:hover>ul {
display: block;
position: absolute;
}
.child {
display: none;
}
.child li {
line-height: 30px;
border-bottom: #CCC 1px solid;
border-right: #CCC 1px solid;
width: 100%;
}
.child li a {
color: #FFFFFF;
}
ul {
list-style-type: none;
margin: 0;
padding: 0px;
min-width: 15em;
}
#nav_ul {
width: 100%;
display: flex;
justify-content: center;
background-color: #1D3567;
}
ul ul ul {
left: 100%;
top: 0;
margin-left: 1px;
}
li:hover {
background-color: #95B4CA;
}
.parent li:hover {
background-color: #95B4CA;
}
<ul id="nav_ul">
<li class="parent">Home</li>
<li class="parent">Outlook Web</li>
<li class="parent">Production
<ul class="child">
<li class="parent">Hennig South</li>
<li class="parent">Hennig Enclosure Systems</li>
<li class="parent">Hennig South</li>
<li class="parent">Factory Andon</li>
<li class="parent">Web Docs</li>
</ul>
</li>
<li class="parent">IT
<ul class="child">
<li>Knowledge Base</li>
<li>Submit a Ticket</li>
<li class="parent">Archived Links</li>
</ul>
</li>
<li class="parent">Office Directories
<ul class="child">
<li>Hennig</li>
<li>AME</li>
</ul>
</li>
<li class="parent">Hennig Parts</li>
<li class="parent">Factory Andon</li>
<li class="parent">Business Cards</li>
<li class="parent">Reports
<ul class="child">
<li class="parent">Global Shop<span class="expand">»</span>
<ul class="child">
<li>Inventory Report</li>
<li>Sales Report</li>
<li>Quotes Report</li>
<li>Work Order Report</li>
<li>Part Where Used Report</li>
</ul>
</li>
<li class="parent">Ndustrios<span class="expand">»</span>
</li>
</ul>
</li>
</ul>

Dropdown menu; hover css doesnot work on Sibling members but work on descendant members

There are two codes below. The codes are for dropdown menu. Both codes are almost same but with a little difference. I have created a main list item for the main menu and given it classes. Then I have created a submenu and given it classes menu. The main heading is given class heading and has element in each of the element.
When I apply ":hover" on (anchor element) element combined with on submenu(dropdown element) the code does not work. While if I apply ":hover" on class heading(class of element) the drop down works.
I am sharing the code to clarify and be more specific.
The following code works for the drop down menu and has hover on heading class. I have commented in the code of css to clarify which part of the code I am referring.
.menu{
padding: 20px;
background: #d80000;
}
.mainmenu{
display: flex;
list-style: none;
}
.heading{
margin-right: 1px;
}
.mainmenu .heading a{
display: inline-block;
padding: 10px;
text-decoration: none;
background: #fff;
color: #d80000;
width: 80px;
text-align: center;
position: relative;
}
.submenu{
list-style: none;
margin-left: -40px;
display: none;
position: absolute;
}
.submenu a{
border-top: 3px solid #d80000;
width: 80px;
}
.heading a:hover{
background: #d80000;
color: #fff;
}
/* Here the hover and submenu element works to make the element display as block*/
.heading:hover .submenu{
display: block;
}
<html>
<head>
<title>Menu</title>
<link rel="stylesheet" type="text/css" href="style5.css">
</head>
<body>
<div class="menu">
<ul class="mainmenu">
<li class="heading">Home
<ul class="submenu">
<li class="items">A</li>
<li class="items">B</li>
<li class="items">C</li>
<li class="items">D</li>
<li class="items">E</li>
</ul>
</li>
<li class="heading">About
<ul class="submenu">
<li class="items">A</li>
<li class="items">B</li>
<li class="items">C</li>
<li class="items">D</li>
<li class="items">E</li>
</ul>
</li>
<li class="heading">Services
<ul class="submenu">
<li class="items">A</li>
<li class="items">B</li>
<li class="items">C</li>
<li class="items">D</li>
<li class="items">E</li>
</ul>
</li>
<li class="heading">Products
<ul class="submenu">
<li class="items">A</li>
<li class="items">B</li>
<li class="items">C</li>
<li class="items">D</li>
<li class="items">E</li>
</ul>
</li>
<li class="heading">Contact
<ul class="submenu">
<li class="items">A</li>
<li class="items">B</li>
<li class="items">C</li>
<li class="items">D</li>
<li class="items">E</li>
</ul>
</li>
</ul>
</div>
</body>
</html>
Now I am going to post the code which is not working for the dropdown menu
In this the element is applied with hover along with submenu class.
.menu{
padding: 20px;
background: #d80000;
}
.mainmenu{
display: flex;
list-style: none;
}
.heading{
margin-right: 1px;
}
.mainmenu .heading a{
display: inline-block;
padding: 10px;
text-decoration: none;
background: #fff;
color: #d80000;
width: 80px;
text-align: center;
position: relative;
}
.submenu{
list-style: none;
margin-left: -40px;
display: none;
position: absolute;
}
.submenu a{
border-top: 3px solid #d80000;
width: 80px;
}
.heading a:hover{
background: #d80000;
color: #fff;
}
/* Here the hover on a and submenu element doesnot works to make the element display as block*/
.heading a:hover .submenu{
display: block;
}
<html>
<head>
<title>Menu</title>
<link rel="stylesheet" type="text/css" href="style5.css">
</head>
<body>
<div class="menu">
<ul class="mainmenu">
<li class="heading">Home
<ul class="submenu">
<li class="items">A</li>
<li class="items">B</li>
<li class="items">C</li>
<li class="items">D</li>
<li class="items">E</li>
</ul>
</li>
<li class="heading">About
<ul class="submenu">
<li class="items">A</li>
<li class="items">B</li>
<li class="items">C</li>
<li class="items">D</li>
<li class="items">E</li>
</ul>
</li>
<li class="heading">Services
<ul class="submenu">
<li class="items">A</li>
<li class="items">B</li>
<li class="items">C</li>
<li class="items">D</li>
<li class="items">E</li>
</ul>
</li>
<li class="heading">Products
<ul class="submenu">
<li class="items">A</li>
<li class="items">B</li>
<li class="items">C</li>
<li class="items">D</li>
<li class="items">E</li>
</ul>
</li>
<li class="heading">Contact
<ul class="submenu">
<li class="items">A</li>
<li class="items">B</li>
<li class="items">C</li>
<li class="items">D</li>
<li class="items">E</li>
</ul>
</li>
</ul>
</div>
</body>
</html>
So my question is why is the code working for the first code and not for the second code. The second code has hover on element while the first code has hover on class of element of the main menu.
.heading a:hover .submenu
^
There you have a descendant combinator.
<li class="heading">Home
<ul class="submenu">
Here the .submenu is a sibling of the a element, not a descendant.
You need one of the sibling combinators
You are not using a in the second one so use
.heading a:hover .submenu{
display: block;
}
here you are making the mistake :
.heading:hover .submenu{
display: block;
}
Use general sibling selector to select .submenu siblings of .heading a:hover. EG:
.heading a:hover ~ .submenu{
display: block;
}
However, now when you move your pointer down to the submenu itself you're no longer hovering on the a so the submenu will revert to display:none;, To resolve this we can insist that the .submenu themselves are display:block; when hovered. EG:
.heading .submenu:hover {
display: block;
}
Working demo:
.menu{
padding: 20px;
background: #d80000;
}
.mainmenu{
display: flex;
list-style: none;
}
.heading{
margin-right: 1px;
}
.mainmenu .heading a{
display: inline-block;
padding: 10px;
text-decoration: none;
background: #fff;
color: #d80000;
width: 80px;
text-align: center;
position: relative;
}
.submenu{
list-style: none;
margin-left: -40px;
display: none;
position: absolute;
}
.submenu a{
border-top: 3px solid #d80000;
width: 80px;
}
.heading a:hover{
background: #d80000;
color: #fff;
}
/* Use general sibling selector to select .submenu siblings of .heading a:hover*/
.heading a:hover ~ .submenu{
display: block;
}
/* however, now when you move your pointer down to the submenu itself you're no longer hovering on the a so the submenu will go back to display none; To resolve this we can insist that the submenu themselves are display block when hovered: */
.heading .submenu:hover {
display: block;
}
<html>
<head>
<title>Menu</title>
<link rel="stylesheet" type="text/css" href="style5.css">
</head>
<body>
<div class="menu">
<ul class="mainmenu">
<li class="heading">Home
<ul class="submenu">
<li class="items">A</li>
<li class="items">B</li>
<li class="items">C</li>
<li class="items">D</li>
<li class="items">E</li>
</ul>
</li>
<li class="heading">About
<ul class="submenu">
<li class="items">A</li>
<li class="items">B</li>
<li class="items">C</li>
<li class="items">D</li>
<li class="items">E</li>
</ul>
</li>
<li class="heading">Services
<ul class="submenu">
<li class="items">A</li>
<li class="items">B</li>
<li class="items">C</li>
<li class="items">D</li>
<li class="items">E</li>
</ul>
</li>
<li class="heading">Products
<ul class="submenu">
<li class="items">A</li>
<li class="items">B</li>
<li class="items">C</li>
<li class="items">D</li>
<li class="items">E</li>
</ul>
</li>
<li class="heading">Contact
<ul class="submenu">
<li class="items">A</li>
<li class="items">B</li>
<li class="items">C</li>
<li class="items">D</li>
<li class="items">E</li>
</ul>
</li>
</ul>
</div>
</body>
</html>

Make parent container the height of a hovered child container

I have searched for the answer to this but out of the questions/answers I found none of them worked in my case.
What I have is a "Mega Menu" with links down the left side, when one of the links are hovered with the mouse it expands to the right showing hidden links with images. What I would like to do is have the left side "hoverable" link area expand to be the same size as the right side area that contains the images.
Currently the left side is a fixed height and when I attempted to apply clear: both overflow: hidden as the other answers on questions suggested it broke the layout. I am hoping there is a pure CSS way of doing what I need. I could write it in JS but would prefer not to if its not needed. I have included a codepen that shows what I have currently.
https://codepen.io/anon/pen/wGZjpp?editors=1100
<div class="megaMenuWrapper">
<div class="megaMenuContainer" style="display: block;">
<ul id="menu-main-menu" class="menu">
<div class="background"><span class="megamenu-title">SHOP BY CATEGORY</span>
<li class="category-item" id="menu-item-3">Showers
<ul class="sub-menu right-side">
<li class="menu-item">
<ul class="sub-menu">
<li id="menu-item-4">
<img src="http://placekitten.com/180/180">Shower Stalls
</li>
<li id="menu-item-8">
<img src="http://placekitten.com/180/180">Shower Bases
</li>
</ul>
</li>
<li class="menu-item">
<ul class="sub-menu">
<li id="menu-item-5">
<img src="http://placekitten.com/180/180">Shower Walls
</li>
</ul>
</li>
</ul>
</li>
<li class="category-item" id="menu-item-9">Toilets
<ul class="sub-menu right-side">
<li class="menu-item">
<ul class="sub-menu">
<li id="menu-item-10">
<img src="http://placekitten.com/180/180">Bidets
</li>
<li id="menu-item-11">
<img src="http://placekitten.com/180/180">Portable Toilets
</li>
</ul>
</li>
<li class="menu-item">
<ul class="sub-menu">
<li id="menu-item-17">
<img src="http://placekitten.com/180/180">Bed Pans
</li>
</ul>
</li>
</ul>
</li>
<li class="category-item" id="menu-item-16">Bathtubs
<ul class="sub-menu right-side">
<li class="menu-item">
<ul class="sub-menu">
<li id="menu-item-18">
<img src="http://placekitten.com/180/180">Clawfoot
</li>
</ul>
</li>
<li class="menu-item">
<ul class="sub-menu">
<li id="menu-item-19">
<img src="http://placekitten.com/180/180">Copper
</li>
</ul>
</li>
</ul>
</li>
<li class="category-item" id="menu-item-20">Sinks
<ul class="sub-menu right-side">
<li class="menu-item">
<ul class="sub-menu">
<li id="menu-item-21">
<img src="http://placekitten.com/180/180">Modern
</li>
</ul>
</li>
</ul>
</li>
<li class="category-item" id="menu-item-25">Bathroom Accessories
<ul class="sub-menu right-side">
<li class="menu-item">
<ul class="sub-menu">
<li id="menu-item-22">
<img src="http://placekitten.com/180/180">Bathtub Faucets
</li>
<li id="menu-item-27">
<img src="http://placekitten.com/180/180">Shower Curtains
</li>
</ul>
</li>
<li class="menu-item">
<ul class="sub-menu">
<li id="menu-item-23">
<img src="http://placekitten.com/180/180">Toilet Brushes
</li>
<li id="menu-item-28">
<img src="http://placekitten.com/180/180">Vanities
</li>
</ul>
</li>
<li class="menu-item">
<ul class="sub-menu">
<li id="menu-item-24">
<img src="http://placekitten.com/180/180">Toilet Seats
</li>
</ul>
</li>
<li class="menu-item">
<ul class="sub-menu">
<li id="menu-item-26">
<img src="http://placekitten.com/180/180">Mirrors
</li>
</ul>
</li>
</ul>
</li>
</div>
</ul>
</div>
</div>
CSS:
body{
background: #ddd;
}
ul#mainnav>li>a:not(.last) {
border-right: 1px solid #fff;
}
ul#mainnav>li>a {
padding: 5px 15px;
margin-top: 20px;
}
.megaMenuWrapper {
position: relative;
margin-top:30px;
}
.megaMenuContainer {
position: absolute;
width: 100%;
/* display: none; */
z-index: 2;
/* height: auto; */
}
ul#menu-main-menu {
width: 100%;
height: 100%;
position: relative;
margin:0;
list-style: none;
}
ul#menu-main-menu .background > li:first-of-type {
margin-top: 5px;
}
.background {
width: 20%;
height: 100%;
background: rgb(255, 255, 255);
border-right: 2px solid #000;
}
.column.menu-item {
padding: 1%;
width: 23%;
}
ul.sub-menu {
list-style: none;
margin: 0;
}
.right-side {
position: absolute;
top: 0;
left: 20%;
height: auto;
right: 0;
width: 80%;
display: none;
}
.right-side li.menu-item {
float: left;
width: 23%;
padding: 1%;
height: 100%;
}
.megamenu-title {
color: #545454;
margin-top: 20px;
display: inline-block;
width: 100%;
margin-left: 20px;
font-weight: bold;
}
li.category-item a{
padding: 5px 0px 5px 20px;
display: block;
}
li.category-item a:hover {
background-color: white;
color: #3C3C3C !important;
text-decoration: none;
}
li.category-item a:hover + ul,
.right-side:hover
{
display: block;
background: rgb(255, 255, 255);
border-left: 1px solid #000;
}
ul#menu-main-menu li.menu-item ul.sub-menu li a {
color: #3c3c3c;
padding: 0;
text-align: center;
}
ul#menu-main-menu li.menu-item ul.sub-menu li a:hover {
background: none;
}
ul#menu-main-menu li.menu-item ul.sub-menu li img {
display: block;
margin: 0 auto;
}
ul#menu-main-menu li a {
color: #4C4C4C;
}
UPDATE:
This is ultimately the jQuery that I have ended up going with. Unless someone answers with a pure CSS solution.
$('.category-item').hover(
function() {
var height = $(this).children('.right-side').outerHeight();
$('.megaMenuContainer').height(height);
},
function() {
$('.megaMenuContainer').css('height', '');
}
);
the idea is the following :
.megaMenuContainer {
height:auto;
}
.category-item {
height:2em;
}
.category-item:hover {
height:3em;
}
in fact if you put the height of the parent equal to auto the height of the child element will follow it.
This is not possible with pure CSS like I wanted with the current structure so I decided to go with the jQuery solution below.
$('.category-item').hover(
function() {
var height = $(this).children('.right-side').outerHeight();
$('.megaMenuContainer').height(height);
},
function() {
$('.megaMenuContainer').css('height', '');
}
);

anchor hit area positioned above anchor text - need it behaving like default anchor hit area would

I have a couple multi-column drop down menus as a part of my main nav. The anchor hit area around each of the links in both multi-column drop down menus is for some reason positioned above the link itself. How do I fix it so the hit area centers around the link text like a normal anchor would?
Here's the site:
http://www.zrrdigitalmedia.com/_ADU/index.html
Here's the HTML & CSS of the nav:
HTML:
<nav class="top-bar bottom-bar" data-topbar>
<section class="top-bar-section">
<ul class="right">
<li>CLIENTS</li>
<li class="divider"></li>
<li>COMPANY</li>
<li class="divider"></li>
<li>DEMO</li>
</ul>
<ul class="right">
<li class="divider"></li>
<li class="has-dropdown not-click">
COURSES
<ul class="dropdown dropdown-wrapper mega-menu">
<li>
<div>
<div class="mega-menu-category small-4 columns">
<ul>
<li><h3>MATH</h3></li>
<li class=""></li>
<li class="mega-menu-item active">GENERAL STUDIES</li>
<li class="mega-menu-item">FINANCE & BUSINESS</li>
<li class="mega-menu-item">ENGINEERING & TECHNICAL</li>
</ul>
</div>
<div class="mega-menu-category small-4 columns">
<ul>
<li><h3>SCIENCE</h3></li>
<li class=""></li>
<li class="mega-menu-item active">PREPERATORY PHYSICS</li>
</ul>
</div>
<div class="mega-menu-category small-4 columns">
<ul>
<li><h3>MARITIME</h3></li>
<li class=""></li>
<li class="mega-menu-item active">SHIP SUPERINTENDENT (MARINE)</li>
<li class="mega-menu-item">SHIP SUPERINTENDENT (GENERAL)</li>
<li class="mega-menu-item">SHIP SUPERINTENDENT (TECHNICAL)</li>
<li class="mega-menu-item">BREAKBULK SHIPPING</li>
<li class="mega-menu-item">LNG CARGO OPERATIONS</li>
<li class="mega-menu-item">MARITIME LOGISTICS 1</li>
<li class="mega-menu-item">MARINE ENGINEERING</li>
<li class="mega-menu-item">SHIP OPERATIONS</li>
</ul>
</div>
</div>
</li>
</ul>
</li>
<li class="divider"></li>
<li class="has-dropdown not-click">
INDUSTRIES
<ul class="dropdown dropdown-wrapper-2 mega-menu-2">
<li>
<div>
<div class="mega-menu-category small-6 columns">
<ul>
<li><h3>HIGHER EDUCATION</h3></li>
<li class=""></li>
<li class="mega-menu-item">HIGHER EDUCATION OVERVIEW</li>
<li class="mega-menu-item">TEACHERS</li>
<ul>
<li class="mega-menu-sub-item">OVERVIEW</li>
<li class="mega-menu-sub-item">COURSES</li>
<li class="mega-menu-sub-item">FEATURES</li>
<li class="mega-menu-sub-item">FAQ</li>
</ul>
<li class="mega-menu-item">ADMINISTRATORS</li>
<ul>
<li class="mega-menu-sub-item">OVERVIEW</li>
<li class="mega-menu-sub-item">IMPLEMENTATION</li>
<li class="mega-menu-sub-item">FAQ</li>
</ul>
</ul>
</div>
<div class="mega-menu-category small-6 columns">
<ul>
<li><h3>MARITIME</h3></li>
<li class=""></li>
<li class="mega-menu-item">MARITIME INDUSTRY</li>
<li class="mega-menu-item">MARITIME INSTITUTIONS</li>
</ul>
</div>
</div>
</li>
</ul>
</li>
<li class="divider"><li>
</ul>
</section>
</nav>
CSS:
.bottom-bar{
position: fixed;
bottom: 0;
width: 100%;
left: 0;
background-color: #d5b93f;
}
.mega-menu{
position: relative;
bottom: 44px;
left: -220px !important;
background-color: #d5b93f;
padding-bottom: 200px;
}
.mega-menu-2{
position: relative;
bottom: 44px;
left: -220px !important;
background-color: #d5b93f;
padding-bottom: 200px;
}
.mega-menu-item a{
height: 20px;
background: #d5b93f !important;
font-size: 12px !important;
padding-left: 0px !important;
padding-right: 0px !important;
}
.mega-menu-sub-item a{
height: 20px;
background: #d5b93f !important;
font-size: 12px !important;
padding-left: 0px !important;
padding-right: 0px !important;
position: relative;
left: 25px;
}
.mega-menu-item a:hover{
height: 20px;
background-color: none !important;
font-size: 12px !important;
padding-left: 0px !important;
padding-right: 0px !important;
}
.top-bar-section li a{
background: none !important;
}
.top-bar-section ul li{
background: none;
font-family: "FuturaStd-Book";
font-size: 20px;
}
.top-bar-section ul li:hover{
background-color: none;
font-family: "FuturaStd-Book";
font-size: 20px;
}
.top-bar-section ul li > a{
color: #60100f;
font-family: "FuturaStd-Book";
font-size: 16px;
}
.top-bar-section ul{
height: 270px !important;
}
.top-bar-section .dropdown li{
height: 20px;
}
.top-bar-section li.active:not(.has-form) a:not(.button){
padding-left: 0px;
padding-right: 0px;
}
.mega-menu-category{
padding-left: 30px !important;
padding-right: 30px !important;
}
h3
{
color: #fff !important;
font-family: "FuturaStd-Book";
}
#media only screen and (min-width: 641px)
{
.dropdown-wrapper
{
background-color: rgba(96, 16, 15, 0.7) !important;
width: 740px !important;
}
.dropdown-wrapper-2
{
background-color: rgba(96, 16, 15, 0.7) !important;
width: 640px !important;
height: 400px !important;
}
}
I'm using Zurb Foundation 5 as a Front-End framework. Been working on this for days & can't figure out why this is happening. All of your support is welcomed & greatly appreciated! Thank you!!
I viewed your site's source code and tried some things and found that you problem is in line 1365 of foundation.css. Just remove the display:block; and your problem disappears!

how can I make a full width dropdown responsive menu

I am somehow not been able to manage this menu to full width
this is my codepen
http://codepen.io/anon/pen/xwDcb
i want my dropdown menu width to be 100% from left to right. What am I doing wrong
body {
background-color:#000;
}
.toggleMenu {
display: none;
background: #666;
padding: 10px 15px;
color: #fff;
text-transform: uppercase;
font-weight: bold;
width:100%;
}
.nav-full {
background:url(../images/nav-bg.png) no-repeat 0 0;
}
.nav-centre {
width:960px;
margin:0 auto
}
.nav {
list-style: none;
*zoom: 1;
}
.nav:before, .nav:after {
content:" ";
display: table;
}
.nav:after {
clear: both
}
.nav ul {
list-style: none;
}
my html code
<a class="toggleMenu" href="#">Menu</a>
<div class="nav-full">
<div class="nav-centre">
<ul class="nav">
<li>HOME
<ul>
<li>Indus Advantage
</li>
<li>Positioning and flexibility of products
</li>
<li>Pipeline
</li>
</ul>
</li>
<li> Products
<ul>
<li>Overview
</li>
<li>Exercise Physiology
</li>
<li>Manufacturing & Quality Control
</li>
</ul>
</li>
<li> Patents & Publications
<ul>
<li>Global Patenting Strategy
</li>
<li>Publications
</li>
</ul>
</li>
<li> Partnering
<ul>
<li>Enquiries - Product
</li>
<li>Enquiries - Business Partnering
</li>
</ul>
</li>
<li> About Us
<ul>
<li>Vision & Values
</li>
<li>Conventional v/s the Indus Discovery Model
</li>
</ul>
</li>
<li> Contact Us
</li>
<li> Careers
</li>
</ul>
</div>
</div>
check with this code
<style>
#nav {
height: 1;
list-style-type: none;
padding-top: 1.25em;
margin-top: 0em;
}
#nav > li { /* Added ">" */
float: right;
position: relative;
padding: 0;
}
#nav li a {
display: inline-block; /* was block */
font-size: 14px;
padding: 0 1em;
margin-bottom: 1em;
color: #333;
text-decoration: none;
border-left: 1px solid #333;
}
#nav .last, #nav li ul li a {
border-left: none;
}
#nav li a:hover, #nav li a:focus {
color: #666;
}
#nav li ul {
opacity: 0;
/*position: absolute;
right: 0em; */
list-style-type: none;
padding: 0; margin: 0;
}
#nav li:hover ul {
opacity: 1;
}
#nav li ul li {
/*float: none;
position: static;
width: auto;*/
height: 0;
line-height: 0;
background: none;
text-align: left;
margin-bottom: .75em;
}
#nav li:hover ul li {
height: 25px;
line-height: 2.5em;
}</style>
<ul id="nav">
<a class="toggleMenu" href="#">Menu</a>
<div class="nav-full">
<div class="nav-centre">
<ul class="nav">
<li>HOME
<ul>
<li>Indus Advantage
</li>
<li>Positioning and flexibility of products
</li>
<li>Pipeline
</li>
</ul>
</li>
<li> Products
<ul>
<li>Overview
</li>
<li>Exercise Physiology
</li>
<li>Manufacturing & Quality Control
</li>
</ul>
</li>
<li> Patents & Publications
<ul>
<li>Global Patenting Strategy
</li>
<li>Publications
</li>
</ul>
</li>
<li> Partnering
<ul>
<li>Enquiries - Product
</li>
<li>Enquiries - Business Partnering
</li>
</ul>
</li>
<li> About Us
<ul>
<li>Vision & Values
</li>
<li>Conventional v/s the Indus Discovery Model
</li>
</ul>
</li>
<li> Contact Us
</li>
<li> Careers
</li>
</ul>
</ul>
</div>
</div>
you have to give the nav-center class 100%, now its at 975px or something like that, and it wrapps your list elements. so the 100% of the unordered list are relative to the nav-center element.
and if you want to get the nav menu centered giv the nav-centre class position:relative;
left: 50% and margin:left -511px. (margin-left should be have of the width of the unordered list)
i think the best solution would be that you put the dropdown menu out of the ul from the navi.
So its not relative to the other list.
markup your html like this:
<a class="toggleMenu" href="#">Menu</a>
<div class="nav-full">
<div class="nav-centre">
<ul class="nav">
<li>HOME</li>
<li> Products</li>
<li> Patents & Publications</li>
<li> Partnering</li>
<li> About Us</li>
<li> Contact Us</li>
<li> Careers </li>
</ul>
<ul>
<li class="under">Indus Advantage</li>
<li class="under">Positioning and flexibility of products</li>
<li class="under">Pipeline
</ul>
<ul>
<li class="under">Overview</li>
<li class="under">Exercise Physiology</li>
<li class="under">Manufacturing & Quality Control</li>
</ul>
<ul>
<li class="under">Global Patenting Strategy</li>
<li class="under">Publications</li>
</ul>
<ul>
<li class="under">Enquiries - Product</li>
<li class="under">Enquiries - Business Partnering</li>
</ul>
<ul>
<li class="under">Vision & Values</li>
<li class="under">Conventional v/s the Indus Discovery Model</li>
</ul>
</div>
</div>
you now just have to give li.under position:absolute and the rest, how to style, should be clear.