I have a drop menu using CSS and now I am told they would like the drop menu to display a bit slower. Everything works great, but I am so far unable to slow down the transition when a user hovers over the navigation. What is the best way of doing this with a CSS only solution?
Demo on JSFiddle
HTML
<nav>
<ul>
<li>Line 1</li>
<li>Line 2
<ul>
<li>SubCat 1</li>
<li>SubCat 2</li>
<li>SubCat 3</li>
</ul>
</li>
<li>Line 3
<ul>
<li>SubCat 4</li>
<li>SubCat 5</li>
<li>SubCat 6</li>
</ul>
</li>
<li>Line 4
<ul>
<li>SubCat 7</li>
<li>SubCat 8</li>
<li>SubCat 9</li>
</ul>
</li>
</ul>
</nav>
CSS
nav {
background: url(../images/global/Navigation_Full.png) no-repeat;
width: 540px;
height: 54px;
margin: 0 auto;
color: #000;
}
nav ul{
display: inline-table;
list-style: none;
width: 100%;
position: relative;
border-top: 1px solid #FF9F69;
}
nav ul:after {
content: ""; clear: both; display: block;
}
nav ul ul {
display: none;
position: absolute;
width: auto;
top: 100%;
}
nav ul li:hover > ul {
display: block;
}
nav li:first-child {
border-left: none;
}
nav li {
text-align: center;
margin-left: 1px;
float: left;
height: 38px;
line-height: 40px;
padding: 0 10px;
}
nav li a {
padding: 10px 17px;
font-size: 0.813em;
text-decoration: none;
text-shadow: inherit;
color: #000;
}
nav li:hover {
box-shadow: 1px 1px 20px 1px rgba(64, 23, 0, 0.4) inset;
-webkit-transition-property:color, background;
-moz-transition-property:color, background;
-webkit-transition-duration: 0.2s;
-moz-transition-duration: 0.2s;
-webkit-transition-timing-function: linear, ease-in;
-moz-transition-timing-function: linear, ease-in;
}
nav ul ul {
background: rgb(125,56,16); /* Old browsers */
background: -moz-linear-gradient(top, rgba(125,56,16,1) 0%, rgba(233,103,31,1) 30px, rgba(233,103,31,1) 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(125,56,16,1)), color-stop(30px,rgba(233,103,31,1)), color-stop(100%,rgba(233,103,31,1))); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, rgba(125,56,16,1) 0%,rgba(233,103,31,1) 30px,rgba(233,103,31,1) 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, rgba(125,56,16,1) 0%,rgba(233,103,31,1) 30px,rgba(233,103,31,1) 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, rgba(125,56,16,1) 0%,rgba(233,103,31,1) 30px,rgba(233,103,31,1) 100%); /* IE10+ */
background: linear-gradient(to bottom, rgba(125,56,16,1) 0%,rgba(233,103,31,1) 30px,rgba(233,103,31,1) 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#7d3810', endColorstr='#e9671f',GradientType=0 ); /* IE6-9 */
border-radius: 0px; padding: 0;
border-top: none;
z-index: 1;
}
nav ul ul li {
float: inherit;
position: relative;
border-left: none;
border-right: none;
text-align: left;
font-size: 1em;
font-weight: lighter;
}
nav ul ul li a {
color: #fff;
}
nav ul ul li a:hover {
color: #000;
}
nav ul ul ul {
position: absolute; left: 100%; top:0;
}
You have animated the main menu but not the dropdown.
I have changed the transition in the dropdown from setting display:block to setting opacity to 1,
nav ul li:hover > ul {
display: block;
opacity: 1;
}
and to the base element, added display block, set opacity to 0, and animated that.
nav ul ul {
background: rgb(125,56,16); /* Old browsers */
display: block;
opacity: 0;
-webkit-transition: opacity 3s;
}
The result is:
http://jsfiddle.net/vals/SmNq3/1/
CSS3 Transitions have a duration property that you can set.
#example
{
transition-property: top;
transition-duration: 2s;
}
Note: Support may require the use of vendor prefixes (-webkit, -o, -ms, -moz).
Try this code in your css
div {
overflow:hidden;
background:#000;
color:#fff;
height:0;
padding: 0 18px;
width:100px;
-webkit-transition: all .5s ease;
-moz-transition: all .5s ease;
transition: all .5s ease;
}
.animated {
height:auto;
padding: 24px 18px;
}
Check this http://jsfiddle.net/catharsis/n5XfG/17/
Related
I have animation setup for a dropdown hover effect and it works each time I hover over it in Firefox and Chrome but it only works on the first hover in Safari.
This is my code, do I need to add anything for it to work everytime I hover in Safari?
#nav ul li:hover ul {
box-shadow: 0 8px 25px rgba(38, 51, 54, .1);
border-radius: 0 0 15px 15px;
background: #fff;
animation-duration: .8s;
animation-name: updown;
}
#keyframes updown {
0% {
transform: translateY(30%);
}
100% {
transform: translateY(0%);
}
}
There must be a problem with other part of your code. This snippet works in safari too.
#nav ul{
list-style:none;
margin:0;
padding:0;
}
#nav ul li{
display: inline-block;
background: #eee;
padding: 10px;
margin: 5px;
position:relative
}
#nav ul li ul{
position:absolute;
display: none;
left:0;
top: 35px;
}
#nav ul li ul li{
display: block;
white-space: nowrap
}
#nav ul li:hover ul {
display: block;
box-shadow: 0 8px 25px rgba(38, 51, 54, .1);
border-radius: 0 0 15px 15px;
background: #fff;
animation-duration: .8s;
animation-name: updown;
}
#keyframes updown {
0% {
transform: translateY(30%);
}
100% {
transform: translateY(0%);
}
}
<div id="nav">
<ul>
<li>Home</li>
<li>Page A</li>
<li>Categories
<ul>
<li>Sub Menu A</li>
<li>Sub Menu B</li>
</ul>
</li>
</ul>
</div>
Mouse move hover to (Main - 1) cause move slowly down (drop down menu) on (Level 1 - 1) to (Level 1 - 4).
Mouse move rollover to (Main - 2) make drop down menu slowly move down.
UL then LI (Main - 1) on hover then UL then appear LI (Level 1 - 1) to (Level 1 - 4) slowly drop down menu.
Not worry about (Main - 4) ignore it.
I don't know where put "-webkit-transition: height 2.75s ease .5s;" into ul and li?
/*
Where can I put drop down menu slwoly?
-webkit-transition: height 2.75s ease .5s;
-moz-transition: height 2.75s ease .5s;
-ms-transition: height 2.75s ease .5s;
-o-transition: height 2.75s ease .5s;
transition: height 2.75s ease .5s;
and
-webkit-transition: opacity 2.75s ease .5s;
-moz-transition: opacity 2.75s ease .5s;
-ms-transition: opacity 2.75s ease .5s;
-o-transition: opacity 2.75s ease .5s;
transition: opacity 2.75s ease .5s;
*/
/*Begin Horizontal Tag.*/
/*Set the parent <li>'s CSS position property to 'relative'.*/
ul {
z-index: 999;
list-style:none;
line-height: 150%;
padding:0px;
margin:0px auto 0 auto;
width: -webkit-fit-content;
width: -moz-fit-content;
width: -ms-fit-content;
width: -o-fit-content;
width: fit-content;
-webkit-border-radius: 15px;
-moz-border-radius: 15px;
-ms-border-radius: 15px;
-o-border-radius: 15px;
border-radius: 15px;
}
ul li {
display: block;
padding: 0px 10px 0px 10px;
position: relative;
float: left;
border-left: 3px solid lightgray;
border-right: 3px solid lightgray;
background: -webkit-linear-gradient(top, #534b4f 0%,#cc5500 100%);
background: -moz-linear-gradient(top, #534b4f 0%,#cc5500 100%);
background: -ms-linear-gradient(top, #534b4f 0%,#cc5500 100%);
background: -o-linear-gradient(top, #534b4f 0%,#cc5500 100%);
background: linear-gradient(top, #534b4f 0%,#cc5500 100%);
-webkit-border-radius: 15px;
-moz-border-radius: 15px;
-ms-border-radius: 15px;
-o-border-radius: 15px;
}
/*The CSS to hide the sub menus.*/
li ul {
display:none;
}
ul li a {
display: block;
padding: 0px;
text-decoration: none;
white-space: nowrap;
color: #ffffff;
}
ul li a:hover {
}
/*Displays the dropdown menu on hover.*/
li:hover > ul {
display: block;
position: absolute;
}
/*try*/
li li {
}
/*Try*/
li:hover li {
float: none;
}
li:hover {
background: #000000;
}
li:hover li a:hover {
}
.main-navigation li ul li {
border-top: 0px;
}
/*Display second level dropdown menus to the right of the first level dropdown menu.*/
ul ul ul {
left: 100%;
top: 0px;
}
/*Simple clearfix.*/
ul:before, ul:after {
content: " "; /* 1 */
display: table; /* 2 */
}
ul:after {
clear: both;
}
<ul>
<li>Main - 1
<ul>
<li>Level 1 - 1</li>
<li>Level 1 - 2</li>
<li>Level 1 - 3</li>
<li>Level 1 - 4</li>
</ul>
</li>
<li>Main - 2
<ul>
<li>Level 2 - 1
<ul>
<li>Level next 2 - 1</li>
<li>Level next 2 - 2</li>
<li>Level next 2 - 3</li>
<li>Level next 2 - 4</li>
</ul>
</li>
<li>Level 2 - 2</li>
<li>Level 2 - 3</li>
<li>Level 2 - 4</li>
</ul>
</li>
<li>Main - 3
<ul>
<li>Level 3 - 1</li>
<li>Level 3 - 2</li>
<li>Level 3 - 3</li>
<li>Level 3 - 4</li>
</ul>
</li>
<li>Main - 4</li>
</ul>
If you want to have opacity transitions, then you cannot use the display none/block in your styles. You should use then opacity values for hiding & displaying content. And this should be placed in the ul > li > ul.
With heights, same issue. You need to play with the heights in order to use the height transition (not with display). For heights case the logical place would be to place it in the same ul > li > ul but this is not possible with the current styling as that ul contents are floating (and thus that ul height definition doesn't have any effect). Additionally height transition doesn't work from 0px => auto/100% so the solution is to use max-height values & transition instead.
Please feel free to correct my statements / assumptions above if someone finds them strange/incorrect.
So this styling would result in what you're after (assuming that I understood the desired result correctly). Result visible in this fiddle.
/*Begin Horizontal Tag.*/
/*Set the parent <li>'s CSS position property to 'relative'.*/
ul {
z-index: 999;
list-style:none;
line-height: 150%;
padding:0px;
margin:0px auto 0 auto;
width: -webkit-fit-content;
width: -moz-fit-content;
width: -ms-fit-content;
width: -o-fit-content;
width: fit-content;
-webkit-border-radius: 15px;
-moz-border-radius: 15px;
-ms-border-radius: 15px;
-o-border-radius: 15px;
border-radius: 15px;
}
ul li {
display: block;
padding: 0px 10px 0px 10px;
position: relative;
float: left;
border-left: 3px solid lightgray;
border-right: 3px solid lightgray;
background: -webkit-linear-gradient(top, #534b4f 0%,#cc5500 100%);
background: -moz-linear-gradient(top, #534b4f 0%,#cc5500 100%);
background: -ms-linear-gradient(top, #534b4f 0%,#cc5500 100%);
background: -o-linear-gradient(top, #534b4f 0%,#cc5500 100%);
background: linear-gradient(top, #534b4f 0%,#cc5500 100%);
-webkit-border-radius: 15px;
-moz-border-radius: 15px;
-ms-border-radius: 15px;
-o-border-radius: 15px;
}
ul > li > ul > li {
max-height: 0px;
}
/*The CSS to hide the sub menus.*/
li ul {
position: absolute;
opacity: 0;
filter: alpha(opacity=0);
}
ul li a {
//display: block;
padding: 0px;
text-decoration: none;
white-space: nowrap;
color: #ffffff;
}
/*Displays the dropdown menu on hover.*/
li:hover > ul {
opacity: 1;
filter: alpha(opacity=100);
-webkit-transition: opacity 1.75s ease 4s;
-moz-transition: opacity 1.75s ease .4s;
-ms-transition: opacity 1.75s ease .4s;
-o-transition: opacity 1.75s ease .4s;
transition: opacity 1.75s ease .4s;
}
li:hover > ul > li {
max-height: 1000px;
-webkit-transition: max-height 2.75s ease .5s;
-moz-transition: max-height 2.75s ease .5s;
-ms-transition: max-height 2.75s ease .5s;
-o-transition: max-height 2.75s ease .5s;
transition: max-height 2.75s ease .5s;
}
/*try*/
li li {
}
/*Try*/
li:hover li {
float: none;
}
li:hover {
background: #000000;
}
li:hover li a:hover {
}
.main-navigation li ul li {
border-top: 0px;
}
/*Display second level dropdown menus to the right of the first level dropdown menu.*/
ul ul ul {
left: 100%;
top: 0px;
}
/*Simple clearfix.*/
ul:before, ul:after {
content: " "; /* 1 */
display: table; /* 2 */
}
ul:after {
clear: both;
}
I have the following piece of code where I am constructing a navigation menu with pure CSS code but there is seeming a problem to me that I can not figure out how to remove out the extra space(padding) between the both sides of the menu means the last and first child.
Plz someone help me out there.
<!DOCTYPE html>
<html>
<head>
<title>Navigation</title>
</head>
<style>
.menu,.sub_menu li,.menu li,.menu a {
margin: 0;
padding: 0;
border: none;
outline: none;
text-decoration: none;
}
.menu {
height: 40px;
width: 535px;
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;
}
.sub_menu li {
display: none;
}
.menu li a {
/*display: block;*/
padding: 0 14px;
line-height: 40px;
/* Border on the left side of the navigation bar */
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;
}
</style>
<body>
<ul class="menu">
<li>My dashboard</li>
<li>Likes</li>
<li>Views
<ul class="sub_menu">
<li>Documents</li>
<li>Messages</li>
<li>Sign Out</li>
</ul>
</li>
<li>Uploads</li>
<li>Videos</li>
<li>Documents</li>
</ul>
</body>
</html>
If you want the width of the .menu element to fit the containing contents, set the display of the element to inline-block and remove the fixed width.
EXAMPLE HERE
.menu {
height: 40px;
display: inline-block;
/* Other styling.. */
}
Additionally, if you want to remove/change the padding on the last/first a elements:
EXAMPLE HERE
.menu li:first-child a {
padding-left: 0;
}
.menu li:last-child a {
padding-right: 0;
}
As a designer for two years, I've always thought it was best to use this piece of code before I try styling my page:
*{
margin: 0;
padding: 0;
overflow: auto;
font-family: inherit;
list-style-type: none;
list-style-position: inside;
}
I use this on top of all my CSS code to eradicate any annoying padding or margin that comes default with some HTML elements.
How do I stop the text in my webpage from breaking to the next line. Its a navigation bar.
I tried both: 'whitespace: nowrap;' and 'overflow: hidden;' which gives me this result:
. The text doesn't break to the next line, but the drop down menus don't work and the text 'Arc Studios' is cut off on the top and bottom.
How do I stop the text from breaking to the next line, while still keeping all of the functions (drop-down menus, and the 'Arc Studios' text)?
CSS
p {
text-align: justify;
color: #000000;
text-indent:5px;
}
body {
background: #f5f5f5;
background-image: url('brushed.png');
}
footer {
background: rgb(63,76,107); /* Old browsers */
background: -moz-linear-gradient(top, rgba(63,76,107,1) 0%, rgba(63,76,107,1) 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(63,76,107,1)), color-stop(100%,rgba(63,76,107,1))); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, rgba(63,76,107,1) 0%,rgba(63,76,107,1) 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, rgba(63,76,107,1) 0%,rgba(63,76,107,1) 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, rgba(63,76,107,1) 0%,rgba(63,76,107,1) 100%); /* IE10+ */
background: linear-gradient(to bottom, rgba(63,76,107,1) 0%,rgba(63,76,107,1) 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#3f4c6b', endColorstr='#3f4c6b',GradientType=0 ); /* IE6-9 */
box-shadow: 0px 1px 3px #000000;
border-radius: 0px;
text-indent: 5px;
position: absolute; right: 0; left: 0;
margin-top: 100px;
}
.menu,
.menu ul,
.menu li,
.menu a {
margin: 0;
padding: 0;
border: none;
outline: none;
overflow: hidden;
white-space: nowrap;
}
.menu {
margin-top: -8px;
height: 50px;
width: 100%;
position: absolute; right: 0; left: 0;
text-align: left;
background: rgb(63,76,107); /* Old browsers */
background: -moz-linear-gradient(top, rgba(63,76,107,1) 0%, rgba(63,76,107,1) 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(63,76,107,1)), color-stop(100%,rgba(63,76,107,1))); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, rgba(63,76,107,1) 0%,rgba(63,76,107,1) 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, rgba(63,76,107,1) 0%,rgba(63,76,107,1) 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, rgba(63,76,107,1) 0%,rgba(63,76,107,1) 100%); /* IE10+ */
background: linear-gradient(to bottom, rgba(63,76,107,1) 0%,rgba(63,76,107,1) 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#3f4c6b', endColorstr='#3f4c6b',GradientType=0 ); /* IE6-9 */
box-shadow: 0px 1px 3px #000000;
-webkit-border-radius: 1px;
-moz-border-radius: 1px;
border-radius: 1px;
}
.menu li {
position: relative;
list-style: none;
float: left;
display: block;
height: 40px;
}
.menu li a { /* Navigation Bar text */
display: block;
padding: 0 20px;
margin: 15px 0;
line-height: 15px;
text-decoration: none;
font-family: sans-serif;
font-weight: bold;
font-size: 12px;
color: red;
/* text-shadow: 1px 1px 1px rgba(255,255,255,0.3); */
-webkit-transition: color .4s ease-in-out;
-moz-transition: color .4s ease-in-out;
-o-transition: color .4s ease-in-out;
-ms-transition: color .4s ease-in-out;
transition: color .4s ease-in-out;
}
.menu li:first-child a{ border-left: none; }
.menu li:last-child a{ border-right: none; }
.menu li:hover > a { text-decoration: underline; }
.menu li#navbar-logo:hover > a { text-decoration: none; }
.menu ul {
position: absolute;
top: 35px;
left: 0;
opacity: 0;
background: rgba(63,76,107,1);
border-left: 1px solid #393942;
border-bottom: 1px solid #393942;
border-right: 1px solid #393942;
-webkit-border-radius: 0 0 2px 2px;
-moz-border-radius: 0 0 2px 2px;
border-radius: 0 0 2px 2px;
-webkit-transition: opacity .75s ease .1s;
-moz-transition: opacity .75s ease .1s;
-o-transition: opacity .75s ease .1s;
-ms-transition: opacity .75s ease .1s;
transition: opacity .75s 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: 35px;
overflow: visible;
padding: 0;
}
.menu ul li a {
width: 100px;
padding: 10px 0 10px 10px;
margin: 0;
border: none;
border-bottom: 1px solid #353539;
}
.menu ul li:last-child a {
border: none;
}
.menu li#navbar-logo,
.menu li#navbar-about,
.menu li#navbar-shop,
.menu li#navbar-contact,
.menu li#navbar-community {
margin-top: 5px;
}
.menu li#navbar-logo {
margin-top: 3px;
}
.menu li#navbar-logo,
.menu li#navbar-about,
.menu li#navbar-shop,
.menu li#navbar-contact,
.menu li#navbar-community {
margin-left: -13px;
margin-right: 5px;
}
.menu li#navbar-about,
.menu li#navbar-shop,
.menu li#navbar-contact,
.menu li#navbar-community {
margin-left: 5px;
margin-right: 5px;
}
#navbar-logo a{
color: #FFC8C8;
text-shadow: 2px 2px 2px rgba(255, 0, 0, 1);
font-size: 50px;
font-family: Intrique Script Personal Use;
}
HTML
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Title of Webpage</title>
<link rel="stylesheet" href="main.css">
</head>
<body>
<header>
<nav class="navbar">
<ul class="menu">
<li id="navbar-logo">Arc Studios</li>
<li id="navbar-about">About Us
<ul>
<li>FAQ's</li>
<li>Our Inception</li>
<li>Locations</li>
</ul>
</li>
<li id="navbar-shop">Store
<ul>
<li>Games</li>
<li>OS's</li>
<li>Other</li>
</ul>
</li>
<li id="navbar-contact">Contact
<ul>
<li>Email</li>
<li>Help Centre</li>
</ul>
</li>
<li id="navbar-community">Community
<ul>
<li>Forums</li>
<li>Events</li>
</ul>
</li>
</ul>
</nav>
</header>
<br></br>
<footer class="footer">
<p><small>© Copyright 2013, All rights reserved</small></p>
</footer>
</body>
</html>
I'm new to HTML, excuse me.
You would need to decrease the padding in the .menu li a style as they are still block type elements, and specifying white-space: nowrap; will not make a difference, because the menu items are split between the li's.
Remove the overflow:hidden; to show the entire logo.
As for the wrapping, if you don't want any collapsing, you need to set a min-width or a fixed width on ul.menu.
Otherwise, you could use media queries to adjust the sizing of the menu links at certain breakpoints.
I for whatever reason cannot get rid of the gap between my header and the nav bar menu. I've tried every adjustment of padding/margins I can think of to either push it up or move the bar, but it just does funky stuff with the menu or pushes other content up. I need some help.
and the code
#header_wrap {
width:100%;
height:144px;
text-align: center;
}
#header {
width:980px;
margin:0 auto;
}
#preloadedImages
{
width: 0px;
height: 0px;
display: none;
background-image:url(Logo/logo14hover.gif);
}
.site_logo {
float:left;
width:302px;
height:144px;
background:url(Logo/logo14.gif) no-repeat;
}
.site_logo:hover {
float:left;
width:302px;
height:144px;
background:url(Logo/logo14hover.gif) no-repeat;
}
.headerpic {
float:left;
width:678px;
height:144px;
background:url(Images/headerpic.gif) no-repeat;
}
#menu_wrap {
position:relative;
z-index:2;
text-align:center;
width:100%;
padding: 0px 0px;
}
#menu {
position:relative;
z-index:2;
width:1000px;
text-align:center;
margin:0 auto;
height:61px;
padding: 0px 0px;
}
nav ul ul {
display: none;
}
nav ul li:hover > ul {
display: block;
}
nav ul {
background: #bbb38f; /* Old browsers */
/* IE9 SVG, needs conditional override of 'filter' to 'none' */
background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2JiYjM4ZiIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiM2YjY0NDEiIHN0b3Atb3BhY2l0eT0iMSIvPgogIDwvbGluZWFyR3JhZGllbnQ+CiAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+);
background: -moz-linear-gradient(top, #bbb38f 0%, #6b6441 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#bbb38f), color-stop(100%,#6b6441)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #bbb38f 0%,#6b6441 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #bbb38f 0%,#6b6441 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #bbb38f 0%,#6b6441 100%); /* IE10+ */
background: linear-gradient(to bottom, #bbb38f 0%,#6b6441 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#bbb38f', endColorstr='#6b6441',GradientType=0 ); /* IE6-8 */
box-shadow: 0px 0px 9px rgba(0,0,0,0.5);
padding: 0px 0px;
list-style:none;
position: relative;
display:inline-table;
text-decoration:none;
font-family:Copperplate Gothic Light,Georgia, Palatino, Times New Roman, serif;
font-size:17px;
color:#FFFFFF;
font-weight:light;
outline:none;
text-shadow: 1px 1px #000000;
}
nav ul:after {
content: ""; clear: both; display: block;
}
nav ul li {
float: left;
}
nav ul li:hover {
background: #736e57;
background: linear-gradient(top, #BBB38F 0%, #6B6441 40%);
background: -moz-linear-gradient(top, #BBB38F4 0%, #6B64415 40%);
background: -webkit-linear-gradient(top, #BBB38F 0%,#6B6441 40%);
text-decoration:none;
font-family:Copperplate Gothic Light,Georgia, Palatino, Times New Roman, serif;
font-size:17px;
color:#FFFFFF;
font-weight:light;
outline:none;
filter:alpha(opacity=100);
opacity: 1;
-moz-opacity:1;
}
nav ul li:hover a {
color:#FFFFFF;
filter:alpha(opacity=100);
opacity: 1;
-moz-opacity:1;
}
nav ul li a {
color:#FFFFFF;
display: block;
padding: 12px 42px;
text-decoration:none;
filter:alpha(opacity=100);
opacity: 1;
-moz-opacity:1;
}
nav ul li:hover > ul {
background: #303030;
text-decoration:none;
display: block;
}
nav ul ul {
background: #303030;
font-family: Helvetica, Copperplate Gothic Light, Arial, sans-serif;
font-size:14px;
text-decoration:none;
color:#000;
font-weight:light;
outline:none;
filter:alpha(opacity=95);
opacity: 0.95;
-moz-opacity:0.95;
}
nav ul ul li {
text-decoration:none;
float: none;
position: relative;
}
nav ul ul li a {
text-decoration:none;
padding: 0px 0px;
color:#000;
filter:alpha(opacity=100);
opacity: 1;
-moz-opacity:1;
}
nav ul ul li a:hover {
text-decoration:none;
background: #736e57;
text-shadow: 1px 1px #000000;
filter:alpha(opacity=100);
opacity: 1;
-moz-opacity:1;
}
nav ul ul {
text-decoration:none;
padding: 0px;
position: absolute;
}
nav ul ul li {
float: none;
position: relative;
}
nav ul ul li a {
filter:alpha(opacity=100);
opacity: 1;
-moz-opacity:1;
padding: 10px 40px 10px 15px;
color:#000;
font-family: Helvetica, Copperplate Gothic Light, Arial, sans-serif;
font-size:15px;
text-align: left;
}
nav ul ul li a:hover {
font-family: Helvetica, Copperplate Gothic Light, Arial, sans-serif;
font-size:15px;
background: #6B6441;
text-align: left;
background: #bbb38f; /* Old browsers */
/* IE9 SVG, needs conditional override of 'filter' to 'none' */
background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2JiYjM4ZiIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiM2YjY0NDEiIHN0b3Atb3BhY2l0eT0iMSIvPgogIDwvbGluZWFyR3JhZGllbnQ+CiAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+);
background: -moz-linear-gradient(top, #bbb38f 0%, #6b6441 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#bbb38f), color-stop(100%,#6b6441)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #bbb38f 0%,#6b6441 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #bbb38f 0%,#6b6441 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #bbb38f 0%,#6b6441 100%); /* IE10+ */
background: linear-gradient(to bottom, #bbb38f 0%,#6b6441 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#bbb38f', endColorstr='#6b6441',GradientType=0 ); /* IE6-8 */
filter:alpha(opacity=100);
opacity: 1;
-moz-opacity:1;
}
nav ul ul ul {
position: absolute;
left: 100%; top:0;
}
and the HTML
<div align="center" id="header_wrap">
<div id="header">
<div id="preloadedImages"></div><div class="site_logo"></div>
<div class="headerpic"></div>
</div>
</div>
<!-- START MENU NAV BAR CODE -->
<div id="menu_wrap">
<div id="menu">
<nav>
<ul>
<li>Company
<ul>
<li>Mission</li>
<li>Philosophy</li>
</ul>
</li>
<li>Solutions
<ul>
<li>Q Pipe Estimator
<ul>
<li>Advantage</li>
<li>Differentiator</li>
<li>Features</li>
<li>Screen Shots</li>
</ul>
</ul>
</li>
</li>
<li>Services
<ul>
<li>Technical Support</li>
<li>Training</li>
<li>Customization</li>
<li>FAQ's</li>
</ul>
</li>
<li>Industry
<ul>
<li>Focus</li>
<li>Customers</li>
</ul>
</li>
<li>Contact
<ul>
<li>Contact Information</li>
<li>Request Information</li>
</ul>
</li>
<li>Login
</li>
</ul>
</nav>
</div>
</div>
<!-- END MENU NAV BAR CODE -->
added fiddle link in comments
Simply remove the default margin for your main ul (the direct descendant of nav)
Select it using the following CSS, or giving that specific ul a class or id (this way you target only the ul causing you trouble).
nav > ul {margin: 0}
I stuck it into the top of your fiddle, and updated it here
I realise this has now been answered because I took way too long formatting this, but I'd just like to point out that it has nothing to do with the box-shadow which has no impact on positioning.
The ul default margin is responsible for this space. Try setting margin-top:0 to nav ul. Demo: http://jsfiddle.net/xtsAx/8/
for me the error was because i used dream weaver to edit my code.
this give me a hiccup by adding default headers.
when i removed those headers and just gave<html> <head>...<?php>....?> .... </html> it worked perfect.
always remove html tags and header by dream weaver.
**Update: I had the same error again in Firefox so i applied
*{
margin:0;
padding:0;
}
And hence got rid of it completely now.
**