Making a scrollable dropdown menu for my page - html

I wanted to make a scrollable dropdown menu for my site. I read through a lot of page talking about scrollable dropdown menu but their code doesn't work. However,my dropdown menu still cannot show a scrollable dropdown menu.
HTML
<li>
Team Profile
<ul>
<li>Chelsea</li>
<li>Man City</li>
<li>Southampton</li>
<li>Man Utd</li>
<li>Arsenal</li>
<li>Liverpool</li>
<li>West Ham</li>
<li>Newcastle</li>
<li>Leichester</li>
<li>QPR</li>
<li>Burnley</li>
<li>Aston Villa</li>
<li>Stoke City</li>
<li>Crystal Palace</li>
<li>Hull City</li>
<li>Sunderland</li>
<li>Tottenham Hotspur</li>
<li>Everton</li>
<li>Swansea</li>
<li>West Brom</li>
</ul>
</li>
CSS
.myDropDown
{
height: 50px;
overflow: auto;
}
.nav ul {
*zoom:1;
list-style:none;
margin:0;
padding:0;
background:#333;
}
.nav ul:before,.nav ul:after {
content:"";
display:table;
}
.nav ul:after {
clear:both;
}
.nav ul > li {
float:left;
position:relative;
}
.nav a {
display:block;
padding:10px 20px;
line-height:1.2em;
color:#fff;
border-left:1px solid #595959;
}
.nav a:hover {
text-decoration:none;
background:#595959;
}
.nav li ul {
background:#273754;
}
.nav li ul li {
width:200px;
}
.nav li ul a {
border:none;
}
.nav li ul a:hover {
background:rgba(0,0,0,0.2);
}
.nav li ul {
position:absolute;
left:0;
top:36px;
z-index:1;
max-height:0;
overflow:hidden;
-webkit-transform:perspective(400) rotate3d(1,0,0,-90deg);
-webkit-transform-origin:50% 0;
-webkit-transition:350ms;
-moz-transition:350ms;
-o-transition:350ms;
transition:350ms;
}
.nav ul > li:hover ul {
max-height:1000px;
-webkit-transform:perspective(400) rotate3d(0,0,0,0);
}
* { margin: 0; padding: 0; }
body { font: 15px Helvetica, Sans-Serif; }
html { overflow-y: scroll; }
#page-wrap { width: 720px; margin: 25px auto; }
p { margin: 0 0 8px 0; }
a { text-decoration: none; }
img { vertical-align: middle; }
a img { border: 0; 180}
ul { list-style: none; }
h1 { margin: 0 0 10px 0; }
/*
LEVEL ONE
*/
ul.dropdown { position: relative; width: 100%; }
ul.dropdown li { font-weight: bold; float: left; width: 180px; background: #ccc; position: relative; }
ul.dropdown a:hover { color: #000; }
ul.dropdown li a { display: block; padding: 20px 8px; color: #222; position: relative; z-index: 2000; }
ul.dropdown li a:hover,
ul.dropdown li a.hover { background: #F3D673; position: relative; }
/*
LEVEL TWO
*/
ul.dropdown ul { display: none; position: absolute; top: 0; left: 0; width: 180px; z-index: 1000; }
ul.dropdown ul li { font-weight: normal; background: #f6f6f6; color: #000; border-bottom: 1px solid #ccc; }
ul.dropdown ul li a { display: block; background: #eee !important; }
ul.dropdown ul li a:hover { display: block; background: #F3D673 !important; }
.FixedHeightContainer
{
float:right;
height: 250px;
width:250px;
overflow: auto;
}
.Content
{
}
li.dropdown-menu-form {
padding: 5px 10px 0;
max-height: 100px;
overflow-y: scroll;
}
#dd-list {
padding-top: 5px;
padding-bottom: 5px;
padding-right: 20px;
padding-left: 10px;
font-weight: normal;
overflow-y: scroll;
}
Corrected CSS:
ul.dropdown-menu-form {
padding-left: 20px;
list-style-type: none;
max-height: 100px;
overflow-y: scroll;
}

JS FIDDLE
HTML
<nav>
<ul class="dropdown">
<li class="drop">Team Profile
<ul class="sub_menu">
<li>Chelsea</li>
<li>Man City</li>
<li>Southampton</li>
<li>Man Utd</li>
<li>Arsenal</li>
<li>Liverpool</li>
<li>West Ham</li>
<li>Newcastle</li>
<li>Leichester</li>
<li>QPR</li>
<li>Burnley</li>
<li>Aston Villa</li>
<li>Stoke City</li>
<li>Crystal Palace</li>
<li>Hull City</li>
<li>Sunderland</li>
<li>Tottenham Hotspur</li>
<li>Everton</li>
<li>Swansea</li>
<li>West Brom</li>
</ul>
</li>
</li>
</ul>
</nav>
CSS
body{
margin: 0px;
padding: 0px;
background: #000;
font-family: 'Lato', sans-serif;
}
h1{
margin: 2em 0px;
padding: 0px;
color: #fff;
text-align: center;
font-weight: 100;
font-size: 50px;
}
nav{
width: 750px;
margin: 1em auto;
}
ul{
margin: 0px;
padding: 0px;
list-style: none;
}
ul.dropdown{
position: relative;
width: 100%;
}
ul.dropdown li{
font-weight: bold;
float: left;
width: 180px;
position: relative;
background: #ecf0f1;
}
ul.dropdown a:hover{
color: #000;
}
ul.dropdown li a {
display: block;
padding: 20px 8px;
color: #34495e;
position: relative;
z-index: 2000;
text-align: center;
text-decoration: none;
font-weight: 300;
}
ul.dropdown li a:hover,
ul.dropdown li a.hover{
background: #3498db;
position: relative;
color: #fff;
}
ul.dropdown ul{
display: none;
position: absolute;
top: 0;
left: 0;
width: 180px;
z-index: 1000;
}
ul.dropdown ul li {
font-weight: normal;
background: #f6f6f6;
color: #000;
border-bottom: 1px solid #ccc;
}
ul.dropdown ul li a{
display: block;
color: #34495e !important;
background: #eee !important;
}
ul.dropdown ul li a:hover{
display: block;
background: #3498db !important;
color: #fff !important;
}
.drop > a{
position: relative;
}
.drop > a:after{
content:"";
position: absolute;
right: 10px;
top: 40%;
border-left: 5px solid transparent;
border-top: 5px solid #333;
border-right: 5px solid transparent;
z-index: 999;
}
.drop > a:hover:after{
content:"";
border-left: 5px solid transparent;
border-top: 5px solid #fff;
border-right: 5px solid transparent;
}
Javascript
/*
*
* Credits to http://css-tricks.com/long-dropdowns-solution/
*
*/
var maxHeight = 400;
$(function(){
$(".dropdown > li").hover(function() {
var $container = $(this),
$list = $container.find("ul"),
$anchor = $container.find("a"),
height = $list.height() * 1.1, // make sure there is enough room at the bottom
multiplier = height / maxHeight; // needs to move faster if list is taller
// need to save height here so it can revert on mouseout
$container.data("origHeight", $container.height());
// so it can retain it's rollover color all the while the dropdown is open
$anchor.addClass("hover");
// make sure dropdown appears directly below parent list item
$list
.show()
.css({
paddingTop: $container.data("origHeight")
});
// don't do any animation if list shorter than max
if (multiplier > 1) {
$container
.css({
height: maxHeight,
overflow: "hidden"
})
.mousemove(function(e) {
var offset = $container.offset();
var relativeY = ((e.pageY - offset.top) * multiplier) - ($container.data("origHeight") * multiplier);
if (relativeY > $container.data("origHeight")) {
$list.css("top", -relativeY + $container.data("origHeight"));
};
});
}
}, function() {
var $el = $(this);
// put things back to normal
$el
.height($(this).data("origHeight"))
.find("ul")
.css({ top: 0 })
.hide()
.end()
.find("a")
.removeClass("hover");
});
});
JS FIDDLE
Credits to: Larry Geams
Credits to: http://css-tricks.com/long-dropdowns-solution/

Related

Hover menu not working properly for submenus

I have a simple vertical hover menu and even when I don't hover over any buttons but the cursor is a little to the right of it, it shows the submenu. When there isn't a submenu the main menu button starts to flicker. I am not entirely sure what is going on and why it is happening. Here is link to show what I mean.
EDIT: Thank you for your responses! Now I'm having a different/almost same problem. The menu doesn't freak out any more, but now there's a bar that sticks out of it and it is still opening the submenus without having to hover over the parent menu. Link to picture here.
Here's my HTML
<div id="divMenu">
<ul>
<li>Home1</li>
<li>Home2
<ul>
<li>Homed</li>
<li>Homee</li>
<li>Homef</li>
</ul></li>
<li>Home3
<ul>
<li>Homeg</li>
<li>Homeh</li>
<li>Homei</li>
</ul></li>
<li>Home4</li>
<li>Home5
<ul>
<li>Homej</li>
<li>Homek</li>
<li>Homel</li>
</ul></li>
<li>Home6</li>
</ul>
</div>
And my CSS
<style type="text/css">
#divMenu {
margin: 0px;
padding: 0px;
}
#divMenu ul {
margin: 0px;
padding: 5px 15px;
}
#divMenu li {
margin: 4px;
padding: 4px;
}
#divMenu li li {
margin: 0px;
padding: 0px;
}
#divMenu {
width: 150px;
height: 27px;
}
#divMenu ul {
line-height: 25px;
}
#divMenu li {
list-style: none;
position: relative;
background: #000;
}
#divMenu li li {
list-style: none;
position: relative;
background: #000;
left: 95px;
top: -30px;
}
#divMenu ul li a {
width: 150px;
height: 25px;
padding: 5px 5px;
display: inline-block;
letter-spacing: 6px;
text-decoration: none;
text-align: left;
font-family: Quicksand Light;
color: #ffffff;
border: 0px;
}
#divMenu ul ul {
position: absolute;
visibility: hidden;
top: 27px;
}
#divMenu ul li:hover ul {
visibility: visible;
}
#divMenu li:hover {
background-color: #fff;
}
#divMenu ul li:hover > a {
background-color: #fff;
color: #000;
}
#divMenu a:hover {
font-weight: normal;
color: #000;
}
</style>
Just remove width:0px from #divMenu ul li:hover > a and #divMenu a:hover from your style.
The problem of the block tripping is because of the width in the block underneath:
#divMenu ul li a {
width: 150px;
height: 25px;
padding: 5px 5px;
display: inline-block;
letter-spacing: 6px;
text-decoration: none;
text-align: left;
font-family: Quicksand Light;
color: #ffffff;
border: 0px;
}
Just remove that width and it should work.
It's due to the zero width you're applying to the links. You really don't need that.
#divMenu ul li:hover > a {
/*width: 0px;*/
background-color: #fff;
color: #000;
}
#divMenu a:hover {
/*width: 0px;*/
font-weight: normal;
color: #000;
}
#divMenu {
margin: 0px;
padding: 0px;
}
#divMenu ul {
margin: 0px;
padding: 5px 15px;
}
#divMenu li {
margin: 4px;
padding: 4px;
}
#divMenu li li {
margin: 0px;
padding: 0px;
}
#divMenu {
width: 150px;
height: 27px;
}
#divMenu ul {
line-height: 25px;
}
#divMenu li {
list-style: none;
position: relative;
background: #000;
}
#divMenu li li {
list-style: none;
position: relative;
background: #000;
left: 95px;
top: -30px;
}
#divMenu ul li a {
width: 150px;
height: 25px;
padding: 5px 5px;
display: inline-block;
letter-spacing: 6px;
text-decoration: none;
text-align: left;
font-family: Quicksand Light;
color: #ffffff;
border: 0px;
}
#divMenu ul ul {
position: absolute;
visibility: hidden;
top: 27px;
}
#divMenu ul li:hover ul {
visibility: visible;
}
#divMenu li:hover {
background-color: #fff;
}
#divMenu ul li:hover > a {
/*width: 0px;*/
background-color: #fff;
color: #000;
}
#divMenu a:hover {
/*width: 0px;*/
font-weight: normal;
color: #000;
}
<div id="divMenu">
<ul>
<li>Home1</li>
<li>Home2
<ul>
<li>Homed</li>
<li>Homee</li>
<li>Homef</li>
</ul></li>
<li>Home3
<ul>
<li>Homeg</li>
<li>Homeh</li>
<li>Homei</li>
</ul></li>
<li>Home4</li>
<li>Home5
<ul>
<li>Homej</li>
<li>Homek</li>
<li>Homel</li>
</ul></li>
<li>Home6</li>
</ul>
</div>

Standalone Bootstrap header not responsive

Since my site has multiple pages which are being designed by multiple people, we decided to create a standalone header. This is the code. While it was working initially, now after some tweaks, it's suddenly no longer responsive. As we use different CSS files, the CSS for this had to written inline, to avoid a clash with the others.
Here is the code, your help in helping me figure out the issue is much appreciated!
Header code (HMTL + Inline CSS):
---------------
<style>
body
{
background-color: #fff;
}
#nav
{
font-family: 'Open Sans', sans-serif;
font-weight: 400;
position: fixed;
top: 0;
right: 1%;
z-index: 1030;
}
#nav > a
{
display: none;
}
#li-bg
{
border: 1px solid #fafafa;
-webkit-border-radius: 6px;
-moz-border-radius: 6px;
border-radius: 3px;
-webkit-background-clip: padding-box;
-moz-background-clip: padding;
background-clip: padding-box;
}
#nav li
{
position: relative;
list-style:none;
-webkit-border-radius: 6px;
border-color: #333 1px solid;
-moz-border-radius: 6px;
border-radius: 3px;
-webkit-background-clip: padding-box;
-moz-background-clip: padding;
background-clip: padding-box;
background-color: transparent;
}
#nav li a
{
display: block;
padding: 3px 20px;
clear: both;
font-weight: normal;
line-height: 20px;
color: #fff;
white-space: nowrap;
background-color: #fcfcfc;
}
#nav li a:active
{
background-color: #3498db!important;
}
#nav span:after
{
width: 0;
height: 0;
border: 0.313em solid transparent; /* 5 */
border-bottom: none;
border-top-color: #fff;
content: '';
vertical-align: middle;
display: inline-block;
position: relative;
right: -0.313em; /* 5 */
}
/* first level */
#nav > ul
{
height: 2.75em; /* 60 */
}
#nav > ul > li
{
height: 100%;
float: right;
width: 130px;
background-color: #3498db;
}
#nav > ul > li > a
{
height: 100%;
font-size: .95em; /* 24 */
line-height: 2.5em; /* 60 (24) */
text-decoration:none;
text-align: center;
background-color:transparent;
}
#nav > ul > li:not( :last-child ) > a
{
border-right: 1px solid transparent;
}
#nav > ul > li:hover > a,
#nav > ul:not( :hover ) > li.active > a
{
}
/* second level */
#nav li ul
{
display: none;
position: absolute;
top: 100%;
padding-top: 8px;
padding-left:40px;
}
#nav li:hover ul
{
display: block;
left: 0;
right: 0;
}
#nav li:not( :first-child ):hover ul
{
left: -1px;
}
#nav li ul a
{
font-size: 1.25em; /* 20 */
border-top: 1px solid #fcfcfc;
background-color:#3498db;
color: #fff;
font-size:.85em;
width:100px;
text-decoration: none;
}
#nav li ul li a:hover,
#nav li ul:not( :hover ) li.active a
{
background-color: #2c81ba;
}
#media only screen and ( max-width: 62.5em ) /* 1000 */
{
#nav
{
width: 100%;
position: static;
margin: 0;
}
}
#media only screen and ( max-width: 40em ) /* 640 */
{
html
{
font-size: 75%; /* 12 */
}
#nav
{
position: relative;
top: auto;
left: auto;
}
#nav > a
{
width: 3.125em; /* 50 */
height: 3.125em; /* 50 */
text-align: left;
text-indent: -9999px;
background-color: #3498db;
position: relative;
}
#nav > a:before,
#nav > a:after
{
position: absolute;
border: 2px solid #fff;
top: 35%;
left: 25%;
right: 25%;
content: '';
}
#nav > a:after
{
top: 60%;
}
#nav:not( :target ) > a:first-of-type,
#nav:target > a:last-of-type
{
display: block;
}
/* first level */
#nav > ul
{
height: auto;
display: none;
position: absolute;
left: 0;
right: 0;
}
#nav:target > ul
{
display: block;
}
#nav > ul > li
{
width: 100%;
float: none;
}
#nav > ul > li > a
{
height: auto;
text-align: left;
padding: 0 0.833em; /* 20 (24) */
}
#nav > ul > li:not( :last-child ) > a
{
border-right: none;
border-bottom: 1px solid #2c81ba;
font-size: 1em;
}
/* second level */
#nav li ul
{
position: static;
padding: 1.25em; /* 20 */
padding-top: 0;
}
}
</style>
<div style="width:100%; position:fixed;background-color:#f8f8f8;top:0;left:0;z-index:1000000; height:47px; font-size:14px!important; font-family: "Open Sans", Helvetica, Arial, sans-serif;">
<div>
<a href="http://www.example.com" style="
padding-left: 100px;
"><img src="http://www.example.com/images/logo.png" border="0"></a>
<nav id="nav" role="navigation" class="mainheader">
<ul class="clearfix">
<li><i class="fa fa-home"></i> Connect </li>
[var.loggedin; if [val] == '1'; then '<li> <span><img src=[var.userpic;htmlconv=no;noerr] class=userpicimg style="width: 40px;border: #446db2 solid 1px;border-radius: 10%;"> [var.userdetails.user_firstname;noerr]</span> <ul> <li>Dashboard</li> <li>Profile</li> <li>Help</li> <li>Logout</li></ul></li>'; else '<li> Log In </li><li>Sign Up</li>';noerr]
</ul>
</nav>
</div>
</div>
Did you add viewport meta tag to your HTML? if not try adding this
<meta name="viewport" content="width=device-width, initial-scale=1">
If it didn't work try adding this to your css as well.
#-ms-viewport{
width: device-width;
}
Hope this Helps :)

Horizontal Menubar

I have a horizontal menubar, and having an issue with the sub-menus. I want the sub-menus to have the same width with their headers(top li?).
Fiddle
I know one way to solve the problem, by giving fixed width to top li elements, but I don't want that. I want each category to have its own width. Is there an alternative way to fix this?
<div id="header">
<div class="container">
<div class="menu-container">
<ul id="menu">
<li>Home</li>
<li>aaaaaaaaaa
<ul>
<li>blabla</li>
<li>bla bla</li>
<li>blabla bla</li>
</ul>
</li>
<li>bbbbbbbbbb
<ul>
<li>blabla</li>
<li>bla bla blabla</li>
</ul>
</li>
<li>cccccccc
<ul>
<li>bla</li>
</ul>
</li>
<li>ddddd</li>
</ul>
</div>
</div>
</div>
<div id="content" class="wrapper"></div>
html, body {
margin: 0;
padding: 0;
width: 100%;
height: 100%;
overflow: auto;
}
body {
background: rgb(36,36,36);
font: normal 100% Arial, Verdana, sans-serif;
}
#header {
background: rgb(16,16,16);
border-top: 3px solid rgb(32,32,32);
border-bottom: 1px solid rgb(32,32,32);
z-index: 100;
}
.container {
width: 960px;
margin: 0 auto;
position: relative;
}
.menu-container {
display: table;
margin: 0 auto;
}
#header ul {
padding: 0;
margin: 0;
list-style: none;
background: rgb(16,16,16);
}
#header ul li {
height: auto;
text-align: center;
width: 130px;
}
#menu {
overflow: auto;
z-index: 100;
width: 665px;
margin: 0 auto;
}
#menu a {
display: block;
padding: 20px;
font-size: 18px;
text-align: center;
font-family: sans-serif;
text-transform: uppercase;
text-decoration: none;
color: WhiteSmoke;
border-right: 1px solid #1d1d1d;
}
#menu a:hover {
color: white;
background: rgb(50,50,50);
}
#menu > li {
float: left;
}
#menu > li.active {
background: rgb(50,50,50);
}
#menu li:nth-child(1) {
border-left: 1px solid rgb(32,32,32);
}
#menu li:hover > ul {
display: block;
}
#menu li ul {
display: none;
z-index: 100;
width: auto;
position: absolute;
}
#menu li ul a {
padding: 10px 0;
}
#menu li ul li {
border-left: 1px solid rgb(32,32,32);
border-bottom: 1px solid rgb(32,32,32);
font-size: .8em;
}
#menu li ul li:nth-child(1) {
border-top: 1px solid rgb(32,32,32);
}
.wrapper {
width: 100%;
min-height: 500px;
overflow: auto;
background: rgb(36,36,36);
border-top: 1px solid rgb(55,55,55);
}
I applied these styles on top of your styles and they seem to have done what you want. (non-fixed width top menu where second layer scales to width of thing above it).
.menu-container { }
.menu-container #menu { width: auto; overflow: visible; height: 60px; }
.menu-container #menu li { position: relative; display: block; width: auto; }
.menu-container #menu li ul { display: none; width: 100%; }
.menu-container #menu li:hover ul { display: block; }
.menu-container #menu li ul li { display: block; width: 100%; }
Here's the fiddle with modified code: http://jsfiddle.net/3zj6E/1/.
The following CSS rule sets were changed:
#menu {
overflow: auto;
z-index: 100;
display: table;
margin: 0 auto;
}
#menu > li {
float: left;
position: relative;
}
#menu li ul {
display: none;
z-index: 100;
position: absolute;
width: 100%;
}

Navigation menu items spacing need to be solved

I have designed a menu.
HTML code is give
<div class="navi">
<ul class="menu">
<li class="current_page_item">Women</li>
<li>Men</li>
<li>Junior</li>
<li>Accessories</li>
<li>Collections
<ul class='children'>
<li>Year</li>
<li>2014
<ul class='children'>
<li>SUMMER</li>
<li>AUTUMN</li>
<li>WINTER</li>
<li>SPRING</li>
</ul>
</li>
<li>2013</li>
</ul>
</li>
<li>Sale</li>
<li class="last"><a href='#'>MY ACCOUNT</a>
</li>
</ul>
<br style="clear:both;" />
</div>
The CSS is give bellow
.navi {
width:1000px;
margin:0 auto;
border-bottom:5px solid #000;
height:50px;
}
.menu {
width:1000px;
margin:0 auto;
}
.menu, .menu ul {
display: block;
list-style-type: none;
margin: 0;
padding: 0;
}
.menu li {
border: 0 none;
display: block;
float: left;
margin: 0;
padding: 0;
position: relative;
z-index: 5;
}
.menu li:hover {
white-space: normal;
z-index: 10000;
}
.menu li li {
float: none;
}
.menu ul {
left: 0;
position: absolute;
top: 0;
visibility: hidden;
z-index: 10;
}
.menu li:hover > ul {
top: 100%;
visibility: visible;
}
.menu li li:hover > ul {
left: 100%;
top: 0;
}
.menu:after, .menu ul:after {
clear: both;
content: ".";
display: block;
height: 0;
overflow: hidden;
visibility: hidden;
}
.menu, .menu ul {
min-height: 0;
}
.menu ul {
margin: -10px 0 0 -30px;
padding: 10px 30px 30px;
}
.menu ul ul {
margin: -30px 0 0 -10px;
padding: 30px 30px 30px 10px;
}
.menu ul li a:hover, .menu li li a:hover {
color: #484848;
text-decoration: none;
}
.menu ul {
min-width: 15em;
width: auto;
}
.menu a.arrow
{
background: url(arrow.gif) no-repeat right center;
}
.menu ul a.arrow
{
background: url(right.gif) no-repeat 97% center;
}
.menu .menuRight
{
float: right;
margin-right: 0px;
}
.menu a {
font-family:Harvest;
color: #314350;
display: block;
height:55px;
line-height:55px;
margin: 0 0px 0 0;
padding: 0 1em;
position: relative;
text-decoration: none;
font-size:18px;
}
.menu a:hover {
background-color: #1c2b36;
color: #ffffff;
box-shadow:#000 0 0 0, inset #3cc0c4 0 -5px 0;
}
.menu .current_page_item a {
background-color:#1c2b36;
color: #ffffff;
box-shadow:#000 0 0 0, inset #3cc0c4 0 -5px 0;
}
.menu li li {
-moz-border-bottom-colors: none;
-moz-border-left-colors: none;
-moz-border-right-colors: none;
-moz-border-top-colors: none;
background: none repeat scroll 0 0 #FFFFFF;
border-color: -moz-use-text-color #B2B2B2 #B2B2B2;
border-image: none;
border-right: 1px solid #B2B2B2;
border-style: none solid solid;
border-width: medium 1px 1px;
color: #444444;
filter: none;
width: auto;
}
.menu li li a {
background-position: 50% 50%;
background-repeat: no-repeat;
border: medium none;
color: #444444;
font-size: 12px;
font-weight: 400;
height: 20px;
line-height: 20px;
padding: 5px 10px;
text-shadow: none;
white-space: nowrap;
}
.menu li li a:hover {
background:#E5E4E4;
border: medium none;
color: #333;
filter: none;
}
.menu ul > li + li {
border-top: 0 none;
}
.menu li li:hover > ul {
left: 100%;
top: 0;
}
.menu > li:first-child > a {
border-left: medium none;
}
.menu > li:first-child > a, .menu li + li + li li:first-child > a {
}
.menu ul.children a, .menu .current_page_ancestor, .menu .current_page_ancestor ul a {
background: none;
filter: none;
}
.menu ul.children a{background:url(images/arrow.png) no-repeat 93% 70%;}
.menu ul.children a:hover{background:url(images/arrow.png) no-repeat 93% 70% #999;}
ul.sub-menu .current_page_item a {
background:none;
}
.footer-box-last {
width:420px;
float:left;
background:#b6c2c9;
height:150px;
}
.footer_outer {
background:url(mail-icon.png) repeat:none;
width:400px;
border-radius:5px;
margin:5px;
background-color:#fff;
}
.footer-box-last h2 {
color:#e8ecee;
font-size:20px;
font-weight:lighter;
margin:15px 15px 15px 7px;
}
.footer-box-last label {
color:#9B9B9A;
font-family:Arial, Helvetica, sans-serif;
font-size:13px;
}
.icon {
width:20px;
height:30px;
float:left;
margin:11px 0 0 5px;
}
.field-2 {
border: medium none;
width:220px;
height:30px;
border-radius:5px;
border:none;
color:#4c565f;
margin:5px;
}
.form_btn {
background-color:#3bc0c3;
color:#ffffff;
float:right;
border-radius:5px;
height:34px;
width:120px;
border:none;
margin:4px;
}
.last {
float:right;
padding-left:60px;
font-style:italic;
}
</style>
I want to move the last li item to the left. then it will look like this n pic
I need a space between SALES and MY ACCOUNT
please help me in this.
Thank you in advance
Try adding this:
.menu li.last {
float:right;
}
You had the right CSS in your code (.last), but you need to give it more authority as it is being overwritten by #menu li code. So on your last declaration change it to ".menu li.last" instead of ".last"
Try This
.menu li.last {
float:right;
}
OR
.menu li:last-child {
float:right;
}
Try this
.menu li:last-child {
float:right;
}
Try this:
.last{
position: relative;
left: -50px;
}

CSS Menu - IE Display Issue

i am trying to create a drop-down menu with rounded corners and have nearly got there but for a small issue in IE. If you view this link (http://ids-ind.com/koris/dropdown.html) in FF it looks and works fine but in IE the right hand side has a flat top.
Please can you advise what i need to do/change to get it looking like it does in FF?
Below is the CSS i am using
a:link {text-decoration:none;}
/* tabs
*************************/
ul.tabs
{
display: table;
margin: 0;
padding: 0;
list-style: none;
position: relative;
}
ul.tabs li
{
margin: 0 0 0 1px;
padding: 0;
list-style: none;
display: table-cell;
float: left;
position: relative;
background:url('../images/menuleft_bg.png') left bottom no-repeat;
line-height:55px;
width:130px;
}
ul.tabs a
{
position: relative;
display: block;
background:url('../images/menuright_bg.jpg') right bottom no-repeat;
}
/* dropdowns
*************************/
ul.dropdown
{
margin: 0;
padding: 0;
display: block;
position: absolute;
z-index: 999;
top: 100%;
width: 130px;
display: none;
left: 0;
}
ul.dropdown ul.dropdown
{
top: 0;
left: 100%;
}
ul.dropdown li
{
margin: 0;
padding: 0;
float: none;
position: relative;
list-style: none;
display: block;
}
ul.dropdown li a
{
display: block;
}
/* menu-specifc
*************************/
#menu
{
position: fixed;
z-index: 5;
top: 0;
left: 0;
height: 40px;
line-height: 40px;
border-bottom: 0px solid #000;
}
#menu ul
{
margin: 0 auto;
}
#menu ul li h4
{
margin: 0;
}
#menu ul li h4 a
{
font-size: 14px;
color: #000;
font-weight: bold;
padding: 0 15px;
}
#menu ul li a
{
color: #fff;
padding-left: 4px;
}
#menu ul li a img
{
vertical-align: middle;
}
#menu ul li a span
{
display: block;
padding: 0 20px;
text-align:center;
}
#menu ul.dropdown
{
padding: 20px 0;
background-image: url('../images/dropdownbg.png');
overflow:hidden;
border-bottom: 0px solid #dc902f;
width: 130px;
z-index:110;
}
#menu ul.dropdown li a
{
border-bottom: 0px solid #e5cd8e;
line-height: 30px;
overflow: hidden;
height: 30px;
background-image: url('../images/dropdownbg2.png');
}
#menu ul.dropdown li.last a
{
border-bottom-width: 0;
}
#menu ul.dropdown li a:hover
{
color:#990000;
}
#menu ul li h4 a:hover
{
background-image: none;
}
remove the position:relative; in below
ul.tabs a{}