Drop-down CSS navigation not working in Firefox - css

I'm working on getting my site up and running, and I've run into a problem with my drop-down navigation menu in Firefox.
I have been using the site in Chrome and it works fine, it is a simple setup of nested lists for the selections. The options appear, but they are floating to the left instead of directly below their appropriate section.
CSS:
/*sub-menu navigation*/
nav.primary ul ul
{
opacity: 0;
filter: alpha(opacity=0);
position: absolute;
z-index: 999;
background: #111111;
height: 0px;
overflow: hidden;
min-width: 100%;
-webkit-transition: opacity 0.4s ease-out;
-moz-transition: opacity 0.4s ease-out;
-o-transition: opacity 0.4s ease-out;
-ms-transition: opacity 0.4s ease-out;
transition: opacity 0.4s ease-out;
-webkit-box-shadow: 0px 2px 2px rgba(0,0,0,0.3);
-moz-box-shadow: 0px 2px 2px rgba(0,0,0,0.3);
box-shadow: 0px 2px 2px rgba(0,0,0,0.3);
}
nav.primary ul li:hover ul
{
opacity: 10;
filter: alpha(opacity=100);
height: auto;
overflow: auto;
}
nav.primary ul ul li
{
float: none;
display: list-item;
border-bottom: 1px solid #747474;
}
nav.primary ul ul li a
{
display: block;
margin-left: 10px;
line-height: 40px;
font-size: 0.8em;
/*text-transform: none;*/
font-family: 'LibbyRegular', Helvetica, Arial, sans-serif;
}
Menu HTML
<ul>
<li>independent work
<ul>
<li>>> big and ugly</li>
<li>>> iceworld</li>
<li>>> gordon's got game</li>
</ul>
</li>
<li>team projects
<ul>
<li>>> blastrobots</li>
<li>>> ruined</li>
</ul>
</li>
<li>scripting
<ul>
<li>>> hero man (C#)</li>
<li>>> CloneOut (lua)</li>
<li>>> shotgun (unrealscript)</li>
</ul>
</li>
<li>resume</li>
</ul>
The site is http://lvsherman.com if you would like to test it.

Try adding to your inner UL elements.
left: 0;
top: WHATEVER;

Related

Navigation Bar - Transparent Issue

I don't understand why I am able to see through my navigation bar like this. I can even highlight the text through it. Any help guys?
Here's the HTML and CSS, when I test this on an online editor, it works properly. But on my local code, it doesn't.
nav{
position: fixed;
top: 0;
left: 0;
width: 100%;
background: #fff;
box-shadow: 0 3px 10px -2px rgba(0,0,0,.1);
border: 1px solid rgba(0,0,0,.1);
}
nav ul{
list-style: none;
position: relative;
float: right;
margin-right: 100px;
display: inline-table;
}
nav ul li{
float: left;
-webkit-transition: all .2s ease-in-out;
-moz-transition: all .2s ease-in-out;
transition: all .2s ease-in-out;
}
nav ul li:hover{background: rgba(0,0,0,.15);}
nav ul li:hover > ul{display: block;}
nav ul li{
float: left;
-webkit-transition: all .2s ease-in-out;
-moz-transition: all .2s ease-in-out;
transition: all .2s ease-in-out;
}
nav ul li a{
display: block;
padding: 30px 20px;
color: #222;
font-size: .9em;
letter-spacing: 1px;
text-decoration: none;
text-transform: uppercase;
}
<nav role="navigation">
<ul>
<li>Home</li>
<li>About Us</li>
<li>Services</li>
<li>Contact Us</li>
</ul>
</nav>
I cant comment, so this appears as an answer but its more a suggestion as I cant see all your code (like where is the Lorem Ipsum coming from?)
You've set the nav to position:fixed, this removes itself from the structure of the DOM. I dont see a z-index property there so that might fix the situation. The text will be hidden behind the navigation if you set the z-index to anything greater than 0.
nav {
position:fixed;
z-index: 1;
...
}
To make sure the text sits underneath the navigation, you may want to set a margin-top to your body tag equating to the height of the navigation bar.

css underline transitions hover state bouncing my list items

What I'm trying to achieve ---> http://jsfiddle.net/46a8u/
I applied those styles to my css. Problem is my links bounce to the left when hovered. I don't want them to move at all. The only transition I want is for the underline to go from left to right in a hover state. I have a codepen link below showing my issue. Again: I do not want my links(Contact, Behance, LinkedIn) to move, just want the underline to appear from left to right when hovered like how it in jsfiddle link I posted above.
Thanks!
My Codepen
http://codepen.io/Chris-Brennan/pen/Gpgvqy
<nav>
<ul id="nav">
<li>Contact</li>
<li>Behance</li>
<li>LinkedIn</li>
</ul>
</nav>
nav{
position:absolute;
right: 0px;
right:350px;
top: 50px;
}
#nav{
list-style-type:none;
}
nav li{
float:left;
margin:0px 10px;
padding-right: 11px;
font-family: 'Lato', sans-serif;
color:#888;
}
nav a{
text-decoration: none;
display: inline-block;
border-bottom: 3px solid blue;
margin-right: 39px;
width: 0px;
-webkit-transition: 0.5s ease;
transition: 0.5s ease;
}
nav a:hover{
-webkit-transition: 0.5s ease;
transition: 0.5s ease;
border-bottom: 3px solid blue;
width: 55px;
margin-right: 9px;
}
Use pseudoclases instead of animating border. Take a look codepen.io/anon/pen/MaYQEp
this is happening because "nav a" margin-right is not good enough and when you are chaning on hover at "nav a:hover" it pushes the content. as per my knowledge you can achieve this by
using following css in "nav a"
nav a{
text-decoration: none;
display: inline-block;
border-bottom: 3px solid blue;
margin-right: 65px;
width: 0px;
-webkit-transition: 0.5s ease;
transition: 0.5s ease;
}
and some the css for "nav a :hover "
nav a:hover{
-webkit-transition: 0.5s ease;
transition: 0.5s ease;
border-bottom: 3px solid blue;
width: 55px;
margin-right: 9px;
}

How to adjust menu's margin and padding without items being out of place

I want to reduce the size of the drop down menus to the same as the buttons. Adjusting either the padding or margin would move the items out of place and close themselves when I try to hover over it. I'd like to know what is causing this. Here's the Fiddle
Any help would be great.
CSS:
.sort ul {
text-align: left;
display: inline;
margin: 0;
list-style: none;
-webkit-box-shadow: 0 0 1px rgba(0, 0, 0, 0.15);
-moz-box-shadow: 0 0 1px rgba(0, 0, 0, 0.15);
float:right;
}
.sort ul li {
font: bold 12px/18px sans-serif;
display: inline-block;
margin-right: -4px;
position: relative;
padding: 15px 20px;
background: #FF5C00 url(http://i1350.photobucket.com/albums/p769/Stonecold_Stone/Games/SoManySales/Joint%20Supplement/alert-overlay_zpsf561d19b.png) repeat-x;
cursor: pointer;
-webkit-transition: all 0.2s;
-moz-transition: all 0.2s;
-ms-transition: all 0.2s;
-o-transition: all 0.2s;
transition: all 0.2s;
color:#fff;
}
.sort ul li:hover {
background: #555;
color: #fff;
}
.sort ul li ul {
padding: 0;
position: absolute;
top: 48px;
left: 0;
width: 150px;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
display: none;
opacity: 0;
visibility: hidden;
-webkit-transiton: opacity 0.2s;
-moz-transition: opacity 0.2s;
-ms-transition: opacity 0.2s;
-o-transition: opacity 0.2s;
-transition: opacity 0.2s;
}
.sort ul li ul li {
background: #FFDFDF;
display: block;
color: #fff;
text-shadow: 0 -1px 0 #000;
z-index:9999;
}
.sort ul li ul li:hover { background: #666; }
.sort ul li:hover ul {
display: block;
opacity: 1;
visibility: visible;
}
.button, ul{ padding-left: 15px;}
.button {
list-style: none; cursor: pointer;
float: left; margin: 10px 10px;
background-color: #039fd3; color: #fff;
padding: 5px 10px;
font-size: 13px;
border-radius: 3px;
-webkit-transition:background-color 0.3s ease-in;
-moz-transition:background-color 0.3s ease-in;
-o-transition:background-color 0.3s ease-in;
transition:background-color 0.3s ease-in;
}
HTML:
<div class="sort"><ul>
<li>
Sort AXXX
<ul>
<li><a href='#'>SXXXX</a></li>
<li><a href='%#%'>AXXXx</a></li>
</ul>
</li>
<li>Sort BXXX
<ul>
<li><a href='%#%'>CXXXX</a></li>
</ul>
</li>
<li>Sort C
<ul>
<li><a href='%#%'>WSXXXX</a></li>
<li><a href='%#%'>SXXXX</a></li>
</ul>
</li>
</ul></div>
Following the op coding style, in order to adjust the width of the dropdown it is required to set a width value for the list items under .sort div. Also added paddings similar to the ones set to the blue buttons on the left.
.sort ul li{
width:70px;
padding-top:5px;
padding-bottom:5px;
padding-left:5px;
padding-right:5px;
}
Also it is necesary to adjust the top relative position of the sub menu to always be below the the main menu,
.sort ul li ul{
top:100%;
}
To adjust the distance from the top of the menu to be the same as with the buttons, it is possible to tweak the top relative distance of the menu to achieve it.
The ul element containing the buttons is a block element and the list items within it are floated with a margin-top of 10px and padding-top of 5px so a total of 15px from the top. The ul element within div.sort is floated to the right and has a padding-top of 5px so with margin-top 10px (i.e. 15-5) should be aligned with the buttons.
.sort > ul{
margin-top:10px;
}
http://jsfiddle.net/fLSyE/
First is, if you want your buttons and drop down menu to have the same size, just set the width to be the same. Here is an example(from your code):
.sort ul li ul {
padding: 0;
position: absolute;
top: 48px;
left: 0;
width: 100px; /* set width of drop down menu to 100px */
-webkit-box-shadow: none;
/* SOME OTHER CODES FOLLOW */
}
.sort ul li {
font: bold 12px/18px sans-serif;
display: inline-block;
margin-right: -4px;
width: 100px; /* also set the width of the menus to 100px */
position: relative;
padding: 15px 20px;
}
Hope it helps!

Third-level nested navigation overlap issue

Please help! Everything in my menu works as I want except this one issue. My third level nested list items are overlaying on the second level and I can't fix it. I have tried everything I can think of, but I am beating my head against a brick wall here.
If someone could please take a look at this code example and help figure out what I am doing wrong it would be greatly appreciated.
I really don't want to have to start from scratch as I like the look and feel of the menu.
Here is my code:
/*navigation*/
nav.primary {
width: 960px;
height: 30px;
font-family: "Source Sans Pro", sans-serif;
font-weight: 400;
position: absolute;
top: 123px;
left: 50%;
margin-left: -34.25em;
border-bottom: #F26621 solid 3px;
z-index: 9999;
}
nav.primary ul, nav.primary ul li { margin: 0px; }
nav.primary select { display: none; }
nav.primary ul li {
display: block;
float: left;
position: relative;
}
nav.primary ul li a {
display: block;
line-height: 28px;
padding: 0 25px;
color: #444;
text-decoration: none;
font-size: 16px;
font-weight: 500;
background: none;
letter-spacing: 0.06em;
border-top-left-radius: 5px;
border-top-right-radius: 5px;
-moz-border-radius-topleft: 5px;
-moz-border-radius-topright: 5px;
}
nav.primary ul li a:hover {
background: #F26621;
color: #FFF;
cursor: pointer;
border-top-left-radius: 5px;
border-top-right-radius: 5px;
-moz-border-radius-topleft: 5px;
-moz-border-radius-topright: 5px;
}
/*sub menu*/
nav.primary ul li ul {
position: absolute;
top: 100%;
left: 0px;
z-index: 998;
opacity: 0.6;
max-height: 0px;
overflow: hidden;
width: auto;
min-width: 188px;
transition: max-height .25s ease-in-out .125s;
-moz-transition: max-height .25s ease-in-out .125s;
-webkit-transition: max-height .25s ease-in-out .125s;
-webkit-box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.3);
-moz-box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.3);
box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.3);
}
nav.primary ul li span { display: none; }
nav.primary ul li:hover ul {
z-index: 999;
height: auto;
max-height: 200px;
opacity: 1;
transition-delay: 0s;
-moz-transition-delay: 0s;
-webkit-transition-delay: 0s;
}
nav.primary ul ul li {
display: block;
float: left;
width: auto;
min-width: 188px;
display: block;
background: #F26621;
border-bottom: 1px solid #999;
}
nav.primary ul ul li a {
display: block;
line-height: 32px;
padding: 0 14px;
font-size: 14px;
letter-spacing: 0.03em;
text-transform: none;
color: #FFF;
border-radius: 0px;
-moz-border-radius: 0px;
-webkit-border-radius: 0px;
transition: background .25s ease 0s;
-moz-transition: background .25s ease 0s;
-webkit-transition: background .25s ease 0s;
}
nav.primary ul ul li a:hover {
background: #F98C58;
border: none;
border-radius: 0px;
-moz-border-radius: 0px;
-webkit-border-radius: 0px;
transition: background .25s ease 0s;
-moz-transition: background .25s ease 0s;
-webkit-transition: background .25s ease 0s;
}
nav.primary ul li:hover > a {
background: #F26621;
color: #FFF;
}
/*third level menu*/
nav.primary ul ul li ul {
position: absolute;
top: 100%;
left: 0px;
z-index: 998;
opacity: 0.6;
max-height: 0px;
overflow: visible;
width: auto;
min-width: 188px;
transition: max-height .25s ease-in-out .125s;
-moz-transition: max-height .25s ease-in-out .125s;
-webkit-transition: max-height .25s ease-in-out .125s;
-webkit-box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.3);
-moz-box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.3);
box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.3);
}
nav.primary ul ul ul li {
float: none;
width: auto;
display: block;
background: #999;
border-bottom: 1px solid #F26621;
}
nav.primary ul ul ul li a {
display: block;
width: auto;
min-width: 188px;
line-height: 32px;
background: #999;
padding: 0 14px 0 28px;
font-size: 12px;
letter-spacing: 0.03em;
text-transform: none;
color: #FFF;
border-radius: 0px;
-moz-border-radius: 0px;
-webkit-border-radius: 0px;
transition: background .25s ease 0s;
-moz-transition: background .25s ease 0s;
-webkit-transition: background .25s ease 0s;
}
nav.primary ul ul ul li a:hover {
background: #F98C58;
border: none;
border-radius: 0px;
-moz-border-radius: 0px;
-webkit-border-radius: 0px;
transition: background .25s ease 0s;
-moz-transition: background .25s ease 0s;
-webkit-transition: background .25s ease 0s;
}
<nav role="navigation" class="primary clearfix">
<ul>
<li class="selected">
Home
</li>
<li>
About Us
<ul>
<li>
Management Team
</li>
<li>
Board of Directors
</li>
<li>
History
</li>
<li>
Collaborations
</li>
<li>
Business Development
</li>
<li>
Contact Us
</li>
</ul>
</li>
<li>
R & D
<ul>
<li>
Pipeline
<ul>
<li>
Ampion
</li>
<li>
Optina
</li>
<li>
NCE001
</li>
</ul>
</li>
<li>
Disease Education
</li>
<li>
Non-core Assets
</li>
</ul>
</li>
<li>
Newsroom
<ul>
<li>
Media
</li>
</ul>
</li>
<li>
Investor Relations
<ul>
<li>
Sec Filings
</li>
<li>
Corporate Governance
</li>
<li>
Stock Information
</li>
<li>
Events & Presentations
</li>
<li>
Investor FAQ
</li>
<li>
Email Alerts
</li>
</ul>
</li>
<li>
Sitemap
</li>
</ul>
<select id="pageParentID" name="pageParentID" class="nav">
<option value="" selected="selected">Go to...</option>
<option value="/zone/">Home</option>
<option value="/zone/about-us.php">About Us</option>
<option value="/zone/management-team.php"> - Management Team</option>
<option value="/zone/board-of-directors.php"> - Board of Directors</option>
<option value="/zone/history.php"> - History</option>
<option value="/zone/collaborations.php"> - Collaborations</option>
<option value="/zone/business-development.php"> - Business Development</option>
<option value="/zone/contact-us.php"> - Contact Us</option>
<option value="/zone/r-d.php">R & D</option>
<option value="/zone/pipeline.php"> - Pipeline</option>
<option value="/zone/ampion.php"> - Ampion</option>
<option value="/zone/optina.php"> - Optina</option>
<option value="/zone/nce001.php"> - NCE001</option>
<option value="/zone/disease-education.php"> - Disease Education</option>
<option value="/zone/non-core-assets.php"> - Non-core Assets</option>
<option value="/zone/newsroom/">Newsroom</option>
<option value="/zone/media.php"> - Media</option>
<option value="/zone/investor-relations.php">Investor Relations</option>
<option value="/zone/sec-filings.php"> - Sec Filings</option>
<option value="/zone/corporate-governance.php"> - Corporate Governance</option>
<option value="/zone/stock-information.php"> - Stock Information</option>
<option value="/zone/events-presentations.php"> - Events & Presentations</option>
<option value="/zone/investor-faq.php"> - Investor FAQ</option>
<option value="/zone/email-alerts.php"> - Email Alerts</option>
<option value="/zone/sitemap.php">Sitemap</option>
</select>
</nav>
I've got it most of the way there. The main issue you had was that you needed to set
display: none;
to the 3rd level nav.
The working changes are in this fiddle

make a header full screen (width) css

I am trying to extend my header to cover the full page. http://dev.webgrowth.biz/ and I want it look like this one http://www.webgrowth.biz/ I have been trying everything for hours now. any help would be highly appreciated.
Live Demo
You can achieve the effect using a container element, then just set the containing elements margin to 0 auto and it will be centered.
Markup
<div id="header">
<div id="headerContent">
Header text
</div>
</div>
CSS
#header{
width:100%;
background: url(yourimage);
}
#headerContent{
margin: 0 auto; width: 960px;
}
Just set the header width to be 100vw to make it full screen width
and set the header height to be 100vh to make it full screen height
#header {
margin: 0;
padding: 0;
width: 100%;
background: xxxx;
}
#header #content {
margin: 0px auto;
width: 800px; /* or whatever */
}
<div id="header">
<div id="content">
stuff here
</div>
</div>
Set the max-width:1250px; that is currently on your body on your #container. This way your header will be 100% of his parent (body) :)
The best way to make the header full screen is set height to be 100vh
#header{
height: 100vh;
}
min-height: 100%;
position: relative;
set the body max-width:110%;
and the make the width on the header 110% it will leave a small margin on left that you can fiX with margin-left: -8px;
margin-top: -10px;
Remove the max-width from the body, and put it to the #container.
So, instead of:
body {
max-width:1250px;
}
You should have:
#container {
max-width:1250px;
}
just do
#RandomDiv{
width: 100%;
}
html:
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css"
</head>
<body>
<ul class="menu">
<li>My Dashboard
<ul>
<li>Learn</li>
<li>Teach</li>
<li>My Library</li>
</ul>
</li>
<li>Likes
<ul>
<li>Pictures</li>
<li>Audio</li>
<li>Videos</li>
</ul>
</li>
<li>Views
<ul>
<li>Documents</li>
<li>Messages</li>
<li>Videos</li>
</ul>
</li>
<li>account
<ul>
<li>Sign In</li>
<li>Register</li>
<li>Deactivate</li>
</ul>
</li>
<li>Uploads
<ul>
<li>Pictures</li>
<li>Audio</li>
<li>Videos</li>
</ul>
</li>
<li>Videos
<ul>
<li>Add</li>
<li>Delete</li>
</ul>
</li>
<li>Documents
<ul>
<li>Upload</li>
<li>Download</li>
</ul>
</li>
</ul>
</body>
</html>
css:
.menu,
.menu ul,
.menu li,
.menu a {
margin: 0;
padding: 0;
border: none;
outline: none;
}
body{
max-width:110%;
margin-left:0;
}
.menu {
height: 40px;
width:110%;
margin-left:-4px;
margin-top:-10px;
background: #4c4e5a;
background: -webkit-linear-gradient(top, #4c4e5a 0%,#2c2d33 100%);
background: -moz-linear-gradient(top, #4c4e5a 0%,#2c2d33 100%);
background: -o-linear-gradient(top, #4c4e5a 0%,#2c2d33 100%);
background: -ms-linear-gradient(top, #4c4e5a 0%,#2c2d33 100%);
background: linear-gradient(top, #4c4e5a 0%,#2c2d33 100%);
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
}
.menu li {
position: relative;
list-style: none;
float: left;
display: block;
height: 40px;
}
.menu li a {
display: block;
padding: 0 14px;
margin: 6px 0;
line-height: 28px;
text-decoration: none;
border-left: 1px solid #393942;
border-right: 1px solid #4f5058;
font-family: Helvetica, Arial, sans-serif;
font-weight: bold;
font-size: 13px;
color: #f3f3f3;
text-shadow: 1px 1px 1px rgba(0,0,0,.6);
-webkit-transition: color .2s ease-in-out;
-moz-transition: color .2s ease-in-out;
-o-transition: color .2s ease-in-out;
-ms-transition: color .2s ease-in-out;
transition: color .2s ease-in-out;
}
.menu li:first-child a { border-left: none; }
.menu li:last-child a{ border-right: none; }
.menu li:hover > a { color: #8fde62; }
.menu ul {
position: absolute;
top: 40px;
left: 0;
opacity: 0;
background: #1f2024;
-webkit-border-radius: 0 0 5px 5px;
-moz-border-radius: 0 0 5px 5px;
border-radius: 0 0 5px 5px;
-webkit-transition: opacity .25s ease .1s;
-moz-transition: opacity .25s ease .1s;
-o-transition: opacity .25s ease .1s;
-ms-transition: opacity .25s ease .1s;
transition: opacity .25s ease .1s;
}
.menu li:hover > ul { opacity: 1; }
.menu ul li {
height: 0;
overflow: hidden;
padding: 0;
-webkit-transition: height .25s ease .1s;
-moz-transition: height .25s ease .1s;
-o-transition: height .25s ease .1s;
-ms-transition: height .25s ease .1s;
transition: height .25s ease .1s;
}
.menu li:hover > ul li {
height: 36px;
overflow: visible;
padding: 0;
}
.menu ul li a {
width: 100px;
padding: 4px 0 4px 40px;
margin: 0;
border: none;
border-bottom: 1px solid #353539;
}
.menu ul li:last-child a { border: none; }
demo here
try also resizing the browser tab to see it in action

Resources