Want to make Superfish vertical menu Responsive - menu

I am using super fish vertical menu but its not working on responsive view. Need to fix this for responsive.

Media queries will help you make it responsive
Have a look at this codepen another great example given in this question
following code is taken from codepen which makes the menu responsive.
#media screen and (max-width: 768px) {
body {
margin: 0; } }
#media screen and (max-width: 768px) {
header.global nav #hamburger {
display: block; } }
header.global nav ul {
margin: 0;
padding: 0 25px;
display: block; }
#media screen and (max-width: 768px) {
header.global nav ul {
display: none;
margin: 7px 0;
padding: 0; } }
#media screen and (max-width: 768px) {
header.global nav ul li {
width: 100%;
background: #2d2d2d;
border-left: none;
border-right: none;
border-top: 1px solid #474747;
border-bottom: 1px solid #141414; }
header.global nav ul li:first-child {
border-top: none; }
header.global nav ul li:last-child {
border-bottom: none; } }
#media screen and (min-width: 768px) {
header.global nav ul li:hover > a {
position: relative; }
header.global nav ul li:hover > a:after {
content: "";
position: absolute;
left: 20px;
top: 40px;
border-width: 0 8px 8px;
border-style: solid;
border-color: rgba(0, 0, 0, 0) rgba(0, 0, 0, 0) #ef3636;
display: block;
width: 0;
z-index: 999; } }
#media screen and (max-width: 768px) {
header.global nav ul li ul {
width: 100% !important;
}
}
#media screen and (min-width: 768px) {
header.global nav ul li ul li:hover a:after {
border: none; } }

Related

Want My Hamburger Menu to Have Opaque White Background and Cover Banner

My website has a hamburger menu made with only HTML and CSS. When the hamburger icon is clicked and the menu activated, the menu titles are displayed over the background image instead of having a white background. (The hamburger menu has a transparent background.) How do I make it so that the menu displays OVER whatever is in the background, with its own white background?`
<div class="nav">
<h1>MA</h1>
<label for="toggle">☰</label>
<input type="checkbox" id="toggle"/>
<div class="menu">
my work
about
contact
</div>
</div>
.nav {
text-align: right;
height: 50px;
line-height: 70px;
margin-bottom: 20px;
margin-top: 15px;
font-family: Gothic A1;
font-size: 20px;
color: black;
}
.menu {
margin: 0 30px 0 0;
background-color: white;
}
.menu a {
clear: right;
text-decoration: none;
color: black;
margin: 0 10px;
line-height: 70px;
padding-left: 30px;
}
.menu a:hover {
color: #edbecb;
text-decoration: none;
}
label {
margin: 0 30px 0 0;
font-size: 50px;
line-height: 70px;
display: none;
width: 26px;
float: right;
}
#toggle {
display: none;
}
#media only screen and (max-width: 500px) {
label {
display: block;
cursor: pointer;
padding-right: 30px;
}
.menu {
text-align: right;
width: 100%;
/* height: 1000px;*/
display: none;
background-color: white;
line-height: 50px;
margin-top: 0px;
padding-right: 30px;
}
.menu a {
display: block;
margin: 0;
background-color: white;
}
#toggle:checked + .menu {
display: block;
background-color: white;
position: absolute;
}
#toggle:checked + .menu a {
background-color: white;
position: absolute;
}
#toggle:checked + label {
background-color: white;
}
}

How to adjust the width of main nav?

How to adjust the width of bg color of main navigation or the whole main navigation? I try to put width:40% but the main nav and footer expanding to the right. Here's the site
I want to make the nav like this
CSS:
.main-navigation {
clear: both;
display: block;
font-weight: 300;
font-family: 'Arial', 'sans-serif';
font-size: 9px;
position: relative;
border-bottom: 3px solid #787878;
background: #787878;
margin: 0 auto;
text-align: center;
float:right;
}
.main-navigation .ak-container{
padding:0 !important;
}
.main-navigation ul {
list-style: none;
margin: 0 auto;
padding: 0;
overflow: hidden;
}
.main-navigation li {
display: inline-block;
position: relative;
line-height:48px;
font-size:18px;
text-transform: initial;
color:#ababab;
text-align: center;
white-space: nowrap;
padding-right:0px;
float:right;
}
.main-navigation.menu-right{
text-align: right;
}
.main-navigation.menu-center{
text-align: center;
}
.main-navigation.menu-right li{
margin-left: 25px;
margin-right:0;
}
.main-navigation.menu-center li{
margin-left: 12px;
margin-right:12px;
}
.main-navigation a {
display: block;
text-decoration: none;
color: #000;
padding: 0 18px;
}
.main-navigation ul ul {
box-shadow: 0 3px 3px rgba(0, 0, 0, 0.2);
display: none;
left: 0;
position: absolute;
z-index: 99999;
background: #FFF;
top: 100%;
border-bottom: 3px solid #4a4a4a;
border-top: 3px solid #4a4a4a;
transition:all 0.3s ease-in-out;
-moz-transition:all 0.3s ease-in-out;
-webkit-transition:all 0.3s ease-in-out;
}
.main-navigation ul li.more-menu-item > ul{
right:0;
left:auto;
}
.main-navigation ul ul ul {
left: 100%;
top: 0;
border-top:none;
}
.main-navigation ul ul a {
min-width: 150px;
padding: 0;
}
.main-navigation ul ul li {
font-size: 16px;
line-height: 18px;
border-bottom: 1px solid #DDD;
margin: 0 !important;
padding:10px 15px;
display: block;
text-align: left;
text-transform: none;
}
.main-navigation ul ul li:last-child{
border-bottom: none;
}
.main-navigation li:hover > a {
background: #585858;
}
.main-navigation ul ul li:hover > a ,
.main-navigation ul ul li.current-menu-item > a {
color: #585858;
}
.main-navigation ul ul a{
color: #666;
background: none !important;
}
.main-navigation ul ul a:hover {
}
.main-navigation ul li:hover > ul {
display: block;
}
.main-navigation .current-menu-parent > a,
.main-navigation .current-menu-item > a,
.main-navigation .current_page_item > a,
.main-navigation .current_page_parent > a {
background: #686868;
}
This float needs to be removed in order to center.
.main-navigation li{
float: right;
}
and then you could use something kind of like:
<div style="border-left:1px solid #000;height:"100%"></div>
inside you #menu-beta_menu div to get those vertical bars happening.
Late Update
The link in the OP is now broken, so I thought I would just add some code to achieve the desired outcome that does not rely on the original HTML & CSS
nav {
position: relative;
float: right;
display: block;
height: 100%;
font-size: 10px;
background-color: #999;
padding: 10px;
}
nav a {
position: relative;
display: inline-block;
height: 100%;
padding: 0 15px;
color: #333;
border-right: 1px solid #333;
text-decoration: none;
}
nav a:last-child {
border-right: none;
}
<nav>
<a href="index.html">
<p>HOME</p>
</a><!--
--><a href="tours-and-hikes.html">
<p>TOURS & HIKES</p>
</a><!--
--><a href="about.html">
<p>ABOUT</p>
</a><!--
--><a href="gallery.html">
<p>GALLERY</p>
</a><!--
--><a href="faq.html">
<p>FAQ's</p>
</a><!--
--><a href="contact.html">
<p>CONTACT</p>
</a>
</nav>

Navigation currently selected item disregards the background-color. (wayfinder, ModX)

The title pretty much describes my problem. I've got a navigation menu at the top of my page with multiple drop-down sections. Now all of the bg-colors are recognised perfectly the only problem is that the menu that you are currently in (lets say 'Weblog') then it disregards the background-color specified and it just gives it the default background. I'm using the Wayfinder snippet in ModX which basically takes all specified pages and puts them in a menu. Ill note the css below since the wayfinder call wont be of much use. I'm open for all kinds of suggestions and improvements.
Cheers,
#nav {
/* float: right; */
font-style:uppercase;
margin-left:100px;
margin-right: 62px;
margin-top: 36px;
z-index: 2;
}
#nav a{
padding: 0 10px;
letter-spacing: 1px;
}
#nav ul {
margin: 0;
padding: 0;
list-style: none;
z-index: 2;
}
#nav ul li.active a {
background: #3f3a2b;
}
#nav ul li:hover{
background-color:#3f3a2b;
}
#nav ul li {
position: relative;
}
#nav ul li a {
font-size: 13px;
padding: 4px 8px;
display: inline-block;
font-family: Georgia, "Times New Roman", Times, serif;
letter-spacing: 1px;
text-transform: uppercase;
font-weight: bold;
line-height: 28px;
color: #fff;
}
#nav ul li ul{
border: 1px solid #2a2a2a;
}
#nav ul li ul li{
}
#nav ul li ul li:hover{
background-color:#3f3a2b;
}
#nav ul li ul li a{
color:black;
font-size:11px;
line-height:15px;
border:none !important;
width:170px;
background: #FFF;
}
#nav ul li ul li a:hover{
background-color:#3f3a2b;
}
#nav ul ul,
#nav ul ul ul {
display: none;
z-index: 2;
}
#nav ul li:hover > ul {
display: block;
position: absolute;
top: 35px;
left: 0;
}
#nav ul li:hover > ul li {
float: none;
background: #FFF;
position: relative;
}
#nav ul li:hover > ul li:hover ul {
display: block;
position: absolute;
top: 0;
left: 186px;
}
#nav ul li ul li a:hover{
background-color:#3f3a2b;
color:white;
}
#nav ul li:hover ul li:hover ul {
display: block;
}
#nav ul li ul li ul li a{
/* line-height:25px !important; */
}
EDIT
Here are some screenshots explaining my problem:
^This is what all items look like.^
^This is what the menu looks like if you are currently in one of its pages^
weblog is li.active and this rule change his color:
#nav ul li.active a {
background: #3f3a2b;
}
#nav ul li.active li a {
background: white;
}
#nav ul li:hover{
background-color:#3f3a2b !important;
}
this fixed the problem for me, thank you all for thinking with me.

Horizontal Menu Not Displaying Inline

I'm having an issue with my horizontal menu. The menu is not displaying inline in IE9. It displays fine in Firefox, Safari and Chrome. Unfortunately I'm working on a Mac and don't have access to IE to test it. Do you have any ideas why it's not working correctly?
Here's my CSS:
.navigationwide {
background-image: url('images/site_gray_bg.png');
border-top: 3px solid #efa320;
-moz-box-shadow: 0px 10px 20px rgba(0,0,0,0.3);
-webkit-box-shadow: 0px 10px 20px rgba(0,0,0,0.3);
box-shadow: 0px 10px 20px rgba(0,0,0,0.3);
}
.navigation {
margin: auto;
width: 960px;
text-align: center;
}
.menu {
margin: 0;
padding: 0;
}
.menu ul {
list-style: none;
margin: 0;
padding: 0;
position: relative;
}
.menu li {
display: inline-block;
padding: 0;
}
.menu li a {
display: block;
font-family: 'Medula One', cursive;
font-size: 30px;
color: #ffffff;
margin: 0;
padding: 15px 25px;
text-align: center;
text-decoration: none;
text-transform: uppercase;
}
.menu li a:hover {
color: #efa320;
}
/* ----------------- SUBMENU START ----------------- */
.menu li ul {
background-image: url('images/site_gray_bg.png');
display: none;
height: auto;
padding: 0;
margin: 0;
position: absolute;
z-index: 200;
}
.menu li:hover ul {
display: block;
}
.menu li li {
background: none;
display: block;
float: none;
margin: 0;
padding: 0;
}
.menu li:hover li a {
background: none;
}
.menu li ul a {
display: block;
font-family: 'Medula One', cursive;
font-size: 24px;
color: #ffffff !important;
margin: 0;
padding: 10px 25px;
text-align: left;
text-decoration: none;
text-transform: uppercase;
border-bottom: 1px solid rgba(255,255,255,.1);
}
.menu li ul a:hover {
color: #ffffff;
background-color: #efa320;
}
I googled and found the following link which might help with your inline question horizontal menu http://openegg.ca/creating-a-horizontal-menu/

IE7 li ul bug on dropdown menu

hoping one of you guys can help me please.
I have a basic list menu with two dropdowns. This all works fine on all browsers except IE6 and IE7. Please take a look at my markup.
<nav>
<ul id="topNav"
><li id="topNavFirst">About Us</li
><li id="topNavSecond"><a href="../people/our-people.php" id="peopleNav">Our People</a
><ul id="subList1"><li>Mike Hadfield</li
><li>Karen Sampson</li
><li>Milhana Farook</li
><li>Kim Crook</li
><li>Amanda Lynch</li
><li>Gideon Scott</li
><li>Paul Fuller</li
><li>Peter Chaplain</li
><li>Laura Hutley</li
></ul
></li
><li id="topNavThird"><a href="../services/our-services.php" id="servicesNav">Our Services</a
><ul id="subList2"><li>Company & Commercial</li
><li>Employment</li
><li>Civil Litigation</li
><li>Debt Recovery</li
><li>Conveyancing</li
><li>Commerical Property</li
><li>Wills & Probate</li
><li>Matrimonial & Family</li
></ul
></li
><li>News</li
><li>Careers</li
><li>Contact</li
></ul><!-- /topNav -->
</nav>​
and the css
a {text-decoration:none;}
#topNav {
float:right;
height:30px;
margin:0;
font-size:12px;
}
#topNav li {
display:inline;
float:left;
list-style:none;
color:#666;
border-left: 1px solid #666;
padding: 0 3px 0 3px;
position:relative;
}
#topNav ul a {
white-space:nowrap;
}
#topNav li a:hover {
border-bottom:2px solid #369;
}
#topNavSecond a:hover {
border-bottom:2px solid transparent !important;
}
#topNavFirst {
border-left: 1px solid transparent !important;
}
/*****OUR-PEOPLE DROPDOWN*****/
#topNav ul{
background:#fff;
border:1px solid #666;
border-top:0px solid transparent;
border-bottom:2px solid #666;
list-style:none;
position:absolute;
left:-9999px;
width:100px;
text-align:left;
padding:5px 0 5px 0px;
margin:0 0 0 -4px;
z-index:10;
-webkit-box-shadow: 1px 1px 1px #666;
-moz-box-shadow: 1px 1px 1px #666;
box-shadow: 1px 1px 1px #666;
vertical-align: bottom;
}
#topNav ul li{
display:block;
border-left:0px;
margin-bottom: 0px;
padding:0;
vertical-align: bottom;
}
#topNav ul a{
padding:0 0 0 5px;
}
#topNav li:hover ul{
left:auto;
}
#topNav li:hover a {
color:#369;
}
#topNav li:hover ul a{
text-decoration:none;
color:#666;
}
#topNav li:hover ul li a:hover{
color:#fff;;
width:100%;
border-bottom:0px solid transparent !important;
}
#topNav ul li:hover {
background:#369;
display: block;
}
#topNav ul li a {
display: block;
padding:0 0 0 4px;
}
/************/
/*****OUR-SERVICES DROPDOWN*****/
#topNavThird a:hover {
border-bottom:2px solid transparent !important;
}
#topNavThird ul{
/*background:#fff url(images/service-ul-bg.png) no-repeat;*/
width:135px !important;
/*margin-left:120px !important;*/
}​
script
jQuery(document).ready(function () {
$('#subList1').css("display", "none");
$('#topNavSecond').hover(function () {
$('#subList1').stop(true, true).fadeIn('400');
},
function(){
$('#subList1').stop(true, true).fadeOut('400');
});
$('#subList2').css("display", "none");
$('#topNavThird').hover(function () {
$('#subList2').stop(true, true).fadeIn('400');
},
function(){
$('#subList2').stop(true, true).fadeOut('400');
});
});
here it is working perfectly
http://jsfiddle.net/BcWd9/6/
here is a screen shot of how it looks in IE7.
hadfield.andymcnallydesign.co.uk/images/ie7-error.jpg
as you can see the ul is appearing to the right of the li and not the left and it is overlaying the top list. I've tried removing white space, but no luck. Any ideas? If one of you can help it would be much appreciated.
Try this—instead of using a left value to hide the submenus, try using display: none; instead. Then position them using left and top on rollover. This seems to work for me in IE7 in windows and Chrome/Firefox, though I haven't been able to test it in IE6.
#topNav ul{
background:#fff;
border:1px solid #666;
border-top:0px solid transparent;
border-bottom:2px solid #666;
list-style:none;
display: none;
width:100px;
text-align:left;
padding:5px 0 5px 0px;
margin:0 0 0 -4px;
z-index:10;
-webkit-box-shadow: 1px 1px 1px #666;
-moz-box-shadow: 1px 1px 1px #666;
box-shadow: 1px 1px 1px #666;
vertical-align: bottom;
}
.
.
.
#topNav li:hover ul{
display: block;
position: absolute;
left: 3px;
top: 14px;
}
Here's an updated version on jsFiddle: http://jsfiddle.net/BcWd9/5/
I had the same problem. The way it worked out for me is adding an explicit width for the li element being displayed on hover
#nav li:hover ul {
display: block;
position: absolute;
margin: 0;
padding: 0;
*zoom:1; /*IE7*/
*width:12em; /*IE7*/
}

Resources