If you reduce my test page here: http://www.linestop.com/Linestop2015/index.php
To display the mobile dropdown menu you will notice that not all my submenu items are displaying. How can I fix this? Can you help me?
Here is my CSS
#navigation { padding:0 21px; margin-bottom: 0; }
.sf-menu{
margin-bottom: 0;
}
.top-nav,.sf-menu li{
background: transparent;
}
.sf-arrows .sf-with-ul:after{
border-top-color: #ff9000;
}
.sf-menu ul li,.sf-menu ul ul li,.sf-menu ul ul ul li {
background: #fff;
}
.sf-menu li:hover, .sf-menu li.sfHover {
background: #ff9000;
}
.sf-menu a{
color: #070707;
border:none;
font-family: 'Open Sans', sans-serif;
text-transform: uppercase;
font-size: 1.2em;
padding-left: 2em;
padding-right: 2em;
}
.small-top-menu{
display: none
}
.small-top-menu select{
padding: 5px;
background: #68ceef;
font-family: 'Open Sans', sans-serif;
text-transform: uppercase;
border:5px solid #fff;
margin: 10px 0;
}
.small-top-menu select option{
padding: 10px;
}
#navigation ul li a { color: #4a4a4a; padding: 0 7px; display:block; height: 21px; line-height: 21px; border: 2px solid transparent; border-radius: 3px; -moz-border-radius: 3px; -webkit-border-radius: 3px; -o-border-radius: 3px; width:100% }
#navigation ul li.active a,
#navigation ul li a:hover { border: 2px solid #029cdb; background: url(images/nav-btn.png) repeat-x 0 0; color:#fff; text-decoration: none; }
#navigation a.nav-btn { display:none; }
Here is my mobile menu css
#navigation { position:relative; z-index: 100; padding:0 0px; margin:0 10px; }
#navigation a.nav-btn { margin-bottom: 15px; text-decoration: none; padding:0 36px 0 10px; line-height:30px; display:block; background: url(images/navigation.png) repeat-x 0 0; height: 30px; position: relative; }
#navigation a.nav-btn span { background: url(images/dd-nav-arrs.png) no-repeat 0 bottom; width: 20px; height: 15px; position:absolute; top: 8px; right: 12px; }
#navigation a.nav-btn.active span { background-position:0 0; }
#navigation ul { display:none; position: absolute; top: 30px; left: 0; width: 100%; }
#navigation ul li { float:none; height: 30px; border-top: 1px solid #fff; display:block; padding:0 0 0 0; background: url(images/navigation.png) repeat-x 0 0; }
#navigation ul li a { border: 0; line-height:30px; float:none; height: 30px; display: block; font-size: 14px; padding-left: 20px; padding-right: 20px; width:100%; border-radius: 0px; -moz-border-radius: 0px; -webkit-border-radius: 0px; -o-border-radius: 0px; box-sizing:border-box; -moz-box-sizing:border-box; -webkit-box-sizing:border-box; }
#navigation ul li a:hover { background-image:url(images/blue-btn.png); border:0; }
#navigation ul li.active span { background: transparent; border:0; }
#navigation ul li.first { display:block; }
Here is my html code
<nav id="navigation"> HOME<span></span>
<section>
<ul class="sf-menu large-12">
<li class="active">Home</li>
<li class="has-dropdown">Services
<ul class="dropdown">
<li class="has-dropdown">Hottap Services
<ul class="dropdown">
<li>Hottap Free Quote</li>
</ul>
</li>
<li>Linestop Services
<ul class="dropdown">
<li>Linestop Free Quote</li>
</ul></li>
<li>Valve Installations Services
<ul class="dropdown">
<li>Valve Install Free Quote</li>
</ul></li>
<li>Pipeline Bypass Services
<ul class="dropdown">
<li>Pipe Bypass Free Quote</li>
</ul></li>
</ul>
</li>
<li class="has-dropdown">Line Stop Equipment
<ul class="dropdown">
<li class="has-dropdown">Hottap Machines
<ul class="dropdown">
<li>Small Machines</li>
<li>Large Machines</li>
</ul>
</li>
<li>Linestop Machines
<ul class="dropdown">
<li>QualTech QT Linestop Machines</li>
<li>IFT Soft Stop 100</li>
<li>IFT Top Pivot Stop 1000</li>
<li>IFT Folding Heads</li>
</ul></li>
<li>Hottap / Linestop Fittings
<ul class="dropdown">
<li>IFT 499 Fittings Copper, Steel & PVC</li>
<li>IFT Mechanical Joint Fittings</li>
<li>IFT Stainless Steel Hottap Linestop Fittings</li>
<li>IFT On-Size Folder Weld Type Fittings</li>
<li>IFT 400 Series Fittings CMLC</li>
<li>IFT 500 Series Fittings CMLC</li>
<li>AWWA - Fittings</li>
<li>Flanged Steel Knife Gate Valves</li>
<li>Completion Plug Assemblies</li>
</ul></li>
<li>All 2.5"-54.6" Linestop™ Cups</li>
</ul>
</li>
<li class="has-dropdown">About us
<ul class="dropdown">
<li>Contact Us</li>
<li>Customers</li>
<li>Location</li>
<li>Job Application</li>
<li>Online Flip Catalog</li>
<li>Facebook Fan Page</li>
</ul>
</li>
<li>Featured Jobs</li>
</ul>
</section>
<div class="cl"> </div>
</nav>
Thanks, Jesse
Look at the #navigation ul styling, the position: absolute; property should only be applied to the first UL ('.sf-menu'). Also check the .sf-menu ul styling, it should have an absolute position. And remove the height from #navigation ul li, because some li items have sub menus but you can't see them because the height is only 30px.
I figured out the answer to my issue. trying to make the menu too complex there were no easy fixes. So i had to go back to the original code and just use the mobile menu for the main navigation menu. Seems to work fine... Thanks for for the help!
Related
Need to know what's going on with my navigation. I'll post a screenshot. I have a drop down list using CSS and it displays fine on Chrome with 4 columns but on FireFox it is shown with 1 big long column. Help?
.nav{ background:#eaeadf; border-top:#eeeee5 solid 1px; margin:0px; box-shadow:0px -5px 5px #E7E9DA inset;}
.nav ul{ text-align: right; }
.nav ul li{ display: inline-block; }
.nav ul li span { color:#7c7c7c; font-size:16px; line-height:27px;}
.nav ul li a{ color:#7c7c7c; font-size:16px; padding:0px 10px; line-height:27px; text-transform:capitalize; margin: 0; display: inline-block; font-family:"Gill Sans", GillSans, Trebuchet, Calibri, sans-serif; letter-spacing: 1px; }
.nav ul li a:hover { color: #960530; }
.nav ul li:after { content:" | " ; color: #7c7c7c; font-size: 16px; line-height: 27px; }
.nav ul li.active:after { content: ""; }
.nav ul li:last-child a { padding-right: 0; }
.nav ul li:last-child:after { content: "";}
.nav ul li.active {
margin-left: -11px;
padding: 0 0 0 10px;
background: url(images/nav-active-left.png) left top no-repeat;
}
.nav ul li.active a {
color: #fff; position: relative;
background: url(images/nav-active-right.png) right top no-repeat; padding: 0 18px 0 12px;
}
.nav ul li.active a:after { top: 100%; border: solid transparent; content: " "; height: 0; width: 0; position: absolute; pointer-events: none; }
.nav ul li.active a:after { border-top-color: #7a0427; border-width: 10px; left: 50%; margin-left: -10px; }
.nav ul li ul { background: #363838; text-align: center; }
.nav ul li.drop ul { display: none; }
/*.nav ul li.drop:hover ul, .nav ul li.drop ul:hover { display: block; }
*/
.extended-menu { background: #363838; padding: 20px; display: none;
-moz-box-shadow: inset 0 11px 10px -7px rgba(0, 0, 0, 0.3);
-webkit-box-shadow: inset 0 11px 10px -7px rgba(0, 0, 0, 0.3);
box-shadow: inset 0 11px 10px -7px rgba(0, 0, 0, 0.3);
}
.extended-menu ul{ text-align: center; display: block; margin: 0 auto; max-width: 1130px; columns: 4; -webkit-columns: 4; column-rule: 2px inset #a9a9a9;
-webkit-column-rule: 2px inset #a9a9a9;
-moz-column-rule: 2px inset #a9a9a9;}
.extended-menu ul li { display: block; margin-bottom: 15px;}
.extended-menu ul li a { padding: 0 10px; margin: 0 10px; font-size:16px; color:#fff; line-height:1.1em !important;}
.extended-menu ul li a:hover { color: #960530; }
.extended-menu ul li:after{ content:" " ; color: #7c7c7c; font-size: 16px; line-height: 27px; }
.extended-menu ul li:last-child:after{ content:"" ; }
<div class="nav">
<div class="wrapper">
<ul>
<li class="drop">Future Students
<ul>
<li>About CU</li>
<li>Academics</li>
<li>Admissions</li>
<li>Apply Now</li>
<li>Athletics</li>
<li>CU Connect</li>
<li>Directory</li>
<li>Financial Services</li>
<li>Graduate Programs</li>
<li>Online & Professional Studies</li>
<li>Request Information</li>
<li>Student Development</li>
<li>Preview Day Registration</li>
<li>Student Right to Know</li>
</ul>
</li>
<li class="drop">Current Students
<ul>
<li>Academic Calendar</li>
<li>Business Office</li>
<li>Canvas Login</li>
<li>Career Services</li>
<li>Catalog, Forms, and Handbooks</li>
<li>Comment Form</li>
<li>CU Connect</li>
<li>Dean of Students</li>
<li>Dining Services</li>
<li>Directory</li>
<li>ePortal</li>
<li>Financial Services</li>
<li>Hire CU</li>
<li>Today # CU</li>
<li>Online & Professional Studies</li>
<li>Residence Life</li>
<li>Rudy Wellness Center</li>
<li>Community </li>
<li>Student Development</li>
<li>Student Policies</li>
<li>Vise Library</li>
<li>Student Email</li>
<li>Student Resources</li>
<li>Student Right to Know</li>
<li>Commencement 2015</li>
</ul>
</li>
<li class="drop">Faculty & Staff
<ul>
<li>Communications</li>
<li>Directory</li>
<li>Dining Services</li>
<li>ePortal</li>
<li>Faculty CAMS Login</li>
<li>Faculty & Staff Email</li>
<li>Intranet</li>
<li>IT Service Request</li>
<li>Rudy Wellness Center</li>
<li>Student Right to Know</li>
</ul>
</li>
<li class="drop">Alumni & Friends
<ul>
<li>Alumni & Friends</li>
<li>Alumni Benefits</li>
<li>Alumni Map</li>
<li>Alumni Update Form</li>
<li>CU Alumni Association</li>
<li>Downloads</li>
<li>Meet the Team</li>
<li>Newsletters</li>
<li>Social Networking</li>
<li>Upcoming Events</li>
<li>Request a Transcript</li>
<li>Sign Up For E-Newsletter</li>
</ul>
</li>
<li class="drop">THE NET.WORK™ Cumberland University Online
<ul>
<li>THE NET.WORK™ Cumberland University Online</li>
<li>Corporate Partners</li>
<li>Business Online</li>
<li>Criminal Justice Online</li>
<li>RN-BSN Online</li>
<li>MAE Online</li>
<li>MBA Online</li>
<li>FAQs</li>
</ul>
</li>
</ul>
<div class="cleer"></div>
</div>
<div class="extended-menu"></div>
<div class="cleer"></div>
</div>
Any help would be appreciated. Again- the code looks fine in Chrome but shows only 1 column in FireFox.
I've coded a css dropdown menu and cant seem to get the name "LOGOS" to stay within the green box when I hover over the word "Illustration". I've made the word 5em so I can see it. Cant get it to stay in the box...no control of it's position. Can you help?
Thanks,
T.
<div id="nav-bar-sm-cont">
<ul id="sm-nav">
<li id="home">HOME</li>
<li id="about">PROFILE</li>
<li id="illustration">ILLUSTRATION
<ul>
<li id="logos">LOGOS</li>
</ul>
</li>
<li id="billboards">BILLBOARDS</li>
<li id="six-mo">6 MO BREAKFAST</li>
<li id="cal">ARTSHOW</li>
<li id="church">CHURCH</li>
<li id="contact">CONTACT</li>
<li id="cat-ill">CAT ILLUSTRATION</li>
<li id="contact-cat">CONTACT CAT</li>
</ul>
</div>
<!--end nav bar sm container -->
/* START small NAV bar **************************/
#nav-bar-sm-cont { position: absolute;
width: 1000px;
height: 100px;
}
#sm-nav li { position: relative;
top: 30px;
left: 35px;
font-size: .6em;
line-height: 250%;
letter-spacing: 0.3em;
list-style-type: none;
float: left;
}
#sm-nav a:link{ text-decoration:none;
color:silver;
background-color:transparent;
padding: 5px 5px;
}
#sm-nav a:visited {text-decoration:none;
color: #9781B7;
padding: 5px 5px;
background-color: transparent;
}
#sm-nav a:hover {text-decoration:none;
color: #fff;
background-color:#a7d6d5;
padding: 5px 5px;
}
#sm-nav a:active {text-decoration:none;
color:#fff;
background-color: green;
padding: 5px 5px;
}
/*start drop down************************************/
#sm-nav li ul { position:relative;
list-style-type: none;
display: none;
}
#sm-nav li:hover ul { position: absolute;
background: green;
padding: 5px 5px;
display:block;
font-size: 5em;
width: 103px;
height: 10px;
}
/*end drop down*****************************************/
/* END small NAV BAR *****************************/
The problem is that your CSS for the li is affecting both the parent li and the child. To fix that just change:
#sm-nav li {
to
#sm-nav > li {
Now that CSS will only affect the parent li and you're free to adjust the CSS for the child however you want like this:
#sm-nav li:hover ul li { }
JSFiddle
Hi I am trying to keep my top navigation menu centered while left aligning the submenus that come out. What do i have to change in order to accomplish this? THanks!
<div id="container">
<ul id="nav">
<li>Home</li>
<li>Services <img src="images/tri2.gif">
<ul>
<li>Massages</li>
<li>Body Treatments</li>
<li>Facials & Waxing</li>
<li>Hair & Nails</li>
</ul>
</li>
<li>Packages <img src="images/tri2.gif">
<ul>
<li>Linky</li>
<li>Linky</li>
<li>Linky</li>
<li>Linky</li>
<li>Linky</li>
<li>Linky</li>
</ul>
</li>
<li>Specials</li>
<li>Contacts</li>
</ul>
</div>
Here is the CSS:
#container {
width: 740px;
margin: -16px auto;
padding: 0 0 0 0px;
font: 100% Helvetica, Arial sans-serif;
font-size:14px;
}
ul#nav {
line-height: 23px;
padding: 0;
}
ul#nav li {
float: left;
position: relative;
list-style: none;
background: #006666;
}
ul#nav li a {
width: 146px;
display: block;
border: 1px solid #000;
text-align: center;
text-decoration: none;
color: #fff;
}
ul#nav li:hover {background: #990000;}
ul#nav ul {
position: absolute;
padding: 0;
left: 0;
top: 23px;
visibility: hidden;
}
ul#nav li:hover ul {visibility: visible;}
ul#nav a:hover {color: yellow;}
http://jsfiddle.net/chuckie365/5LuCA/
what you need here is an additional CSS targeting that a elements:
ul#nav ul li a {
text-align:left;
}
Heres is the demo http://jsfiddle.net/5LuCA/10/
I'm making a navigation bar. Here's the reference link
The problem is the style I've applied for Main Tabs is repeating for Sub Links as well. I've created separate class for the sub links("nav2"). It works fine in Chrome & Mozilla Firefox, but not able to solve this issue in IE. Please Help, Its bit urgent.
Here's my code
HTML:
<div id="menu">
<ul id="nav">
<li>Tab1
<ul id="nav2">
<li>Menu 1 Submenu item 1</li>
<li>Menu 1 Submenu item 2</li>
<li>Menu 1 Submenu item 3</li>
</ul>
</li>
<li>Tab2
<ul id="nav2">
<li>Sub Link for tab 2</li>
<li>Some other link</li>
<li>Some othe rlink</li>
</ul>
</li>
<li>Tab3</li>
<li>Tab4</li>
</li>
</ul>
</div>
Here's the css
CSS:
#menu {
width: 100%;
height: 35px;
clear: both;
}
ul#nav {
float: left;
width:100%;
margin: 0;
padding: 0;
list-style: none;
-moz-border-radius-topright: 5px;
-webkit-border-top-right-radius: 5px;
-moz-border-radius-topleft: 5px;
-webkit-border-top-left-radius: 5px;
}
ul#nav li {
display: inline;
}
ul#nav li a {
float: left;
font-family:Arial, Helvetica, sans-serif;
font-size:12px;
font-weight:bold;
line-height: 35px;
color: #7e764c;
text-decoration: none;
text-shadow: 1px 1px #ffffff;
margin:0 4px 0 0;
padding: 0 15px;
-moz-border-radius-topright: 5px;
-webkit-border-top-right-radius: 5px;
-moz-border-radius-topleft: 5px;
-webkit-border-top-left-radius: 5px;
background: #fff3b3;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffce9', endColorstr='#fff3b3');
background: -webkit-gradient(linear, 0 0, 0 70%, from(#fffce9), to(#fff3b3));
background: -moz-linear-gradient(#fffce9, #fff3b3 70%);
background: linear-gradient(#fffce9, #fff3b3 70%);
-pie-background: linear-gradient(#fffce9, #fff3b3 70%);
behavior: url(PIE.htc);
}
ul#nav .current a, ul#nav li:hover > a {
color: #353535;
text-decoration: none;
text-shadow: 1px 1px #ffe8a1;
background: #fecf3a;
-moz-border-radius-topright: 5px;
-webkit-border-top-right-radius: 5px;
-moz-border-radius-topleft: 5px;
-webkit-border-top-left-radius: 5px;
}
ul#nav ul {
display: none;
}
ul#nav2 li a {
background:none;
}
ul#nav li:hover > ul {
position: absolute;
display: block;
width: 100%;
height: 35px;
position: absolute;
margin: 35px 0 0 0;
background-color:#fecf3a;
border-bottom:1px solid #c3aa6f;
}
ul#nav li:hover > ul li {
float: left;
font-family:Arial, Helvetica, sans-serif;
font-size:11px;
font-weight:normal;
line-height: 35px;
color: #86610b;
text-decoration: none;
margin: 0;
background:url(../img/line1.jpg) no-repeat right 15px;
}
ul#nav li:hover > ul li a {
float: left;
font-family:Arial, Helvetica, sans-serif;
font-size:11px;
font-weight:normal;
line-height: 35px;
color: #86610b;
text-decoration: none;
margin: 0;
background:url(../img/arrow-btm2.png) no-repeat center 28px;
}
ul#nav li:hover > ul li a:hover {
color: #86610b;
text-decoration: none;
text-shadow: none;
}
Thanks in Advance
First: You have not added a class to the submenus. You have added the id "nav2" and ids should be unique. You should change this to class="nav2" and use .nav2 instead of #nav2 in your css to target that.
There are two good ways to solve this.
1)
Create classes for the toplevel items. Something like:
<ul id="nav">
<li class="navLevel1">Tab1
And then you change ul#nav li to .navLevel1 and ul#nav li a to .navLevel1 > a in your css.
2)
Change ul#nav li to #nav > li and #nav li a to #nav > li > a in your css
Note:
I used the child selector(>) which means you only select direct children of the element instead of descendants.
I have a menu bar..it appears correctly(horizontal) in mozilla and chrome but appears vertical in IE8.
how can i make it horizontal using css
here is the html code
<div id="navigation">
<div id="myjquerymenu" class="jquerycssmenu">
<br/>
<ul>
<li class="txtfont">Manage Image</li>
<li class="txtfont">Manage Menu
<ul>
<li class="txtfont">Manage Parent Menu</li>
<li class="txtfont">Manage Sub Menu</li>
<li class="txtfont">Manage Sub Sub Menu</li>
</ul>
</li>
<li class="txtfont">Manage Content
<ul>
<li class="txtfont">Main Content</li>
<li class="txtfont">News</li>
<li class="txtfont">Announcements</li>
</ul>
</li>
<li class="txtfont">Manage FAQ</li>
<li class="txtfont">Manage Settings</li>
<li>Log Out</li>
</ul>
</div>
</div>
The css code is as below:
#navigation { height: 80px; width:200%; position: relative; padding-top:10px; padding-left:200px; float:none; font-size:12px; font-family: "Century Gothic"; font-weight:bold; }
.jquerycssmenu{
font-size:12px;
font-family: "Trebuchet MS", "sans-serif";
/*padding-left: 0px; offset of tabs relative to browser left edge*/
margin-top:25px;
color:#FFFFFF;
font-weight:normal;
border:#000000;
}
.jquerycssmenu ul{
margin: 0;
padding: 0;
list-style-type: none;
}
/*Top level list items*/
.jquerycssmenu ul li{
position: relative;
display: inline;
float: left;
border-bottom-color:#000000;
}
/*Top level menu link items style*/
.jquerycssmenu ul li a{
display: block;
padding: 6px 7px 6px 7px;
min-width:70px;
margin-right: 6px; /*spacing between tabs*/
border: 1px solid #000000;
border-bottom-width: 1;
color:#FFFFFF;
text-decoration: none;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
background-color:#330066;
/*background-color:#99CC00;*/
text-align:center;
/*background: url(../../images/admin/images/menu_bg.jpg);*/
background-color:#330066;
behavior: url(border-radius.htc);
}
.jquerycssmenu ul li a:hover{
background:#663399;
}
/*1st sub level menu*/
.jquerycssmenu ul li ul{
position: absolute;
left: 0;
display: block;
visibility: hidden;
padding-top:0px;
}
/*Sub level menu list items (undo style from Top level List Items)*/
.jquerycssmenu ul li ul li{
display: list-item;
float: none;
-moz-border-radius: 0px;
-webkit-border-radius: 0px;
border-radius: 0px;
font-family: "Trebuchet MS", "sans-serif";
}
/*All subsequent sub menu levels vertical offset after 1st level sub menu */
.jquerycssmenu ul li ul li ul{
top: 0;
display: list-item;
float: none;
font-family: "Trebuchet MS", "sans-serif";
}
/* Sub level menu links style */
.jquerycssmenu ul li ul li a{
font-family:"Trebuchet MS", "sans-serif";
font-size:13px;
font-weight:normal;
width: 160px; /*width of sub menus*/
background-color:#330066;
color:#FFFFFF;
padding: 6px 5px;
margin: 0;
border-top-width: 1;
-moz-border-radius: 0px;
-webkit-border-radius: 0px;
border-radius: 1px;
}
.jquerycssmenu ul li ul li a:hover{ /*sub menus hover style*/
background:#663399;
color: #ccc;
}
Since there is no code to analyze at this point in time, here are my thoughts...
If you're using display: inline-block; I know this doesn't work in IE7. However, it should work in IE8, FF, Chrome.
You may want to try float: left; on the menu items to see if that fixes your problem.
Your problem as described is not evident in IE8.. for me in IE8 using the code as posted (adding the missing closing tags and another menu level) the menu is horizontal
however I've tidied up the code as there was a large horizontal scroll in all browsers and "sticky" hover bugs in IE7 so maybe there's a difference somewhere, that will fix IE8 for you too
Example Fiddle : here
This works (as in it looks the same, I'm not sure if it's your exact intention) - in all browsers tested in