i already did a drop down menu in my wordpress site. its a common drop down menu. but now i need to make it as a multi column drop down submenu.
i went through so many sites and tried different css. nothing creates anything like in that reference site. please help me with customizing the existing css style to attain multicolumn submenu structure.
my current menu css:-
.menu{
width:941px;
max-width:100%;
height:47px;
margin-left:30px;
float:left;
background:url(../images/other.gif) repeat-x;
}
.menu ul{padding:0px 0px 0px 0px;
margin:0px 0px 0px 0px;
}
.menu li:first-child{
margin:0px 0px 0px 0px;
padding:16px 0px 0px 40px;
list-style:none;
background-image:url(../images/hom.gif);
background-repeat:repeat-x;
float:left;
height:47px;
}
.menu li{
margin:0px 0px 0px 0px;
padding:16px 0px 10px 30px;
list-style:none;
background-image:url(../images/nav_img.png);
background-repeat:no-repeat;
float:left;
height:47px;
}
.menu a{
font-family:Tahoma, Geneva, sans-serif;
font-size:14px;
font-weight:bold;
color:#000;
letter-spacing:2px;
padding-right:10px;
text-transform: uppercase;
text-decoration:none;
transition: text-shadow 1s;
-moz-transition: text-shadow 1s; /* Firefox 4 */
-webkit-transition: text-shadow 1s; /* Safari and Chrome */
-o-transition: text-shadow 1s; /* Opera */
}
.menu a:hover{
text-shadow: 0 0 5px #006994;
color:#ccffff;
}
.menu .current-menu-item{
text-shadow: 0 0 5px #fff;
}
#cssmenu ul li.hover,
#cssmenu ul li:hover {position: relative; z-index: 599; cursor: default;}
#cssmenu ul ul {visibility: hidden; position: absolute; top: 64%; left: 0; z-index: 598; width:auto;}
#cssmenu ul ul li {float: none;background:#3891C9!important;border-bottom:1px solid #00569c;height:auto;}
#cssmenu ul ul ul {top:0; left: auto; right: -99.5%; width:100%;}
#cssmenu ul li:hover > ul { visibility: visible;}
#cssmenu ul ul {bottom: 0; left: 0;}
#cssmenu ul ul {margin-top: 0; }
#cssmenu ul ul li {font-weight: normal;border-left:1px solid #00569c;}
#cssmenu ul ul a { display:block; line-height:1em; text-align:left; letter-spacing:0.5px;font-size:12px;}
#cssmenu ul ul li a:hover{ color:#ccffff; }
#cssmenu > ul { *display: inline-block; }
#cssmenu:after, #cssmenu ul:after {
content: '';
display: block;
clear: both;
}
the menu structure is :
<div id="cssmenu" class="menu">
<ul class="menu">
<li>
<ul class="sub-menu">
<li>test1</li>
<li>test2</li>
</ul>
</li>
</ul>
</div>
currently my menu like this http://jsfiddle.net/2wxje/
My CSS:
#menu, #menu ul {
margin: 0;
padding: 0;
list-style: none;
}
#menu {
width: 480px;
margin: 10px auto;
border: 1px solid #222;
background-color: #111;
background-image: linear-gradient(#444, #111);
border-radius: 6px;
box-shadow: 0 1px 1px #777;
}
#menu:before,
#menu:after {
content: "";
display: table;
}
#menu:after {
clear: both;
}
#menu {
zoom:1;
}
#menu li {
float: left;
position: relative;
}
#menu a {
float: left;
padding: 12px 30px;
color: #999;
text-transform: uppercase;
font: bold 12px Arial, Helvetica;
text-decoration: none;
text-shadow: 0 1px 0 #000;
}
#menu li:hover > a {
color: #fafafa;
}
*html #menu li a:hover { /* IE6 only */
color: #fafafa;
}
#menu ul {
margin: 20px 0 0 0;
_margin: 0; /*IE6 only*/
opacity: 0;
visibility: hidden;
position: absolute;
top: 38px;
left: 0;
z-index: 1;
background: #444;
background: linear-gradient(#444, #111);
box-shadow: 0 -1px 0 rgba(255,255,255,.3);
border-radius: 3px;
transition: all .2s ease-in-out;
}
#menu li:hover > ul {
opacity: 1;
visibility: visible;
margin: 0;
}
#menu ul ul {
top: 0;
left: 150px;
margin: 0 0 0 20px;
_margin: 0; /*IE6 only*/
box-shadow: -1px 0 0 rgba(255,255,255,.3);
}
#menu ul li {
float: none;
display: block;
border: 0;
_line-height: 0; /*IE6 only*/
box-shadow: 0 1px 0 #111, 0 2px 0 #666;
}
#menu ul li:last-child {
box-shadow: none;
}
#menu ul a {
padding: 10px;
width: 130px;
_height: 10px; /*IE6 only*/
display: block;
white-space: nowrap;
float: none;
text-transform: none;
}
#menu ul a:hover {
background-color: #FF0064;
background-image: linear-gradient(#FF0064, #FF0010);
}
#menu ul li:first-child > a {
border-radius: 3px 3px 0 0;
}
#menu ul li:first-child > a:after {
content: '';
position: absolute;
left: 40px;
top: -6px;
border-left: 6px solid transparent;
border-right: 6px solid transparent;
border-bottom: 6px solid #444;
}
#menu ul ul li:first-child a:after {
left: -6px;
top: 50%;
margin-top: -6px;
border-left: 0;
border-bottom: 6px solid transparent;
border-top: 6px solid transparent;
border-right: 6px solid #3b3b3b;
}
#menu ul li:first-child a:hover:after {
border-bottom-color: #FF0064;
}
#menu ul ul li:first-child a:hover:after {
border-right-color: #FF0064;
border-bottom-color: transparent;
}
#menu ul li:last-child > a {
border-radius: 0 0 3px 3px;
}
#menu li:hover > .no-transition {
display: block;
}
Javascript Code:
<script>
var $=jQuery;
$(document).ready(function(){
var location=window.location.pathname;
$("#menu a").each(function(){
if(location.lastIndexOf($(this).attr("href"))!=-1){
$(this).css({color:"white"});
}
});
});
</script>
PHP Code:
<?php wp_nav_menu(
array(
'title_li' => '',
'menu_id' => 'menu',
'menu_class' => '',
'theme_location' => 'primary-menu',
)
); ?>
Related
My website is
http://www.jokerleb.com
I want the right column to be on the right, and the left to be on the left. All columns must have the same margin between them. In summary I don't want the menu to be centered.
The menu itself is float: left I can't see any margin that is forcing it to the center, and I don't know what div is centralizing it. Any idea why it's centered?
The css of the menu
.header_menu_res ul,
.header_menu_res ul ul,
.header_menu_res ul ul ul {
float: left;
margin: 0;
padding: 0;
list-style: none;
}
.header_menu_res ul li.first {
padding-left: 0;
background: none;
}
.header_top .header_top_res p a{
color: #FDC300 !important;
}
/*menu font color*/
.header_menu_res ul li a {
color: #FDC300;
font-size: 17px;
font-weight: bold;
text-decoration: none;
}
.header_menu_res ul {
z-index: 99;
margin: 3px;
padding: 0;
list-style: none;
line-height: 1;
}
.header_menu_res ul a {
padding: 5px 10px;
position: relative;
color: #555;
z-index: 100;
display: block;
line-height: 18px;
text-decoration: none;
}
.header_menu_res ul li:hover a {
-webkit-border-radius: 3px;
border-radius: 3px;
}
.header_menu_res ul li.current_page_item,
.header_menu_res ul li.current-menu-item,
.header_menu_res ul li.current-menu-parent a {
color: #555;
background: #f4f4f4;
-webkit-border-radius: 3px;
border-radius: 3px;
}
.header_menu_res ul li li.current_page_item,
.header_menu_res ul li li.current-menu-item {
background: none;
}
.header_menu_res ul li.current_page_item a,
.header_menu_res ul li.current-menu-item a {
color: #555;
-webkit-border-radius: 3px;
border-radius: 3px;
}
.header_menu_res ul.children li a {
background: #fff;
border-top: none;
border-left: none;
}
.header_menu_res ul li {
float: left;
/
font: normal 14px/1.2em Arial, Helvetica, sans-serif;
z-index: 999;
margin: 0 0 20px;
width: 25%;
}
.menu-item i._mi, .menu-item img._mi {
display: block;
float: left;
}
.menu-item span {
margin-top: 8px;
display: block;
margin-left: 60px;
}
.header_menu_res ul li ul {
margin-top: -2px;
background: #fff;
position: absolute;
left: -999em;
width: 180px;
border: 1px solid #dbdbdb;
border-width: 1px 1px 0;
z-index: 998;
-webkit-border-radius: 0 3px 3px 3px;
border-radius: 0 3px 3px 3px;
}
.header_menu_res ul.menu ul {
background-color: #FFF;
border: 1px solid #eee;
border-top: none;
z-index: 998;
-webkit-border-radius: 0 6px 6px 6px;
border-radius: 0 6px 6px 6px;
-moz-box-shadow: 1px 1px 5px #b7b7b7;
-webkit-box-shadow: 1px 1px 5px #b7b7b7;
box-shadow: 1px 1px 5px #b7b7b7;
}
.header_menu_res ul.menu ul ul.children {
background-color: #FFF;
border: 1px solid #eee;
border-top: none;
z-index: 998;
-webkit-border-radius: 6px;
border-radius: 6px;
-moz-box-shadow: 1px 1px 5px #b7b7b7;
-webkit-box-shadow: 1px 1px 5px #b7b7b7;
box-shadow: 1px 1px 5px #b7b7b7;
}
.header_menu_res ul.menu li ul li {
margin: 0;
padding: 0px;
}
.header_menu_res ul.menu li ul li a {
background: none;
padding: 7px 12px;
width: 156px;
color: #555;
font-size: 14px;
line-height: 18px;
}
.header_menu_res ul.menu li ul li a:hover {
text-decoration: underline;
-webkit-border-radius: 3px;
border-radius: 3px;
}
.header_menu_res ul.menu li ul ul {
margin: -32px 0 0 181px;
-webkit-border-radius: 0 3px 3px 3px;
border-radius: 0 3px 3px 3px;
}
.header_menu_res ul.menu ul.sub-menu {
display: none;
position: absolute;
margin: -2px 0 0;
-webkit-border-radius: 0 3px 3px 3px;
border-radius: 0 3px 3px 3px;
}
.header_menu_res ul.menu li:hover ul.sub-menu {
display: block;
}
.header_menu_res ul.menu ul.sub-menu li ul.sub-menu {
display: none;
top: 2px;
left: 180px;
-webkit-border-radius: 0 3px 3px 0;
border-radius: 0 3px 3px 0;
}
.header_menu_res ul.menu ul.sub-menu li:hover ul.sub-menu {
display: block;
}
.header_menu_res ul li:hover,
.header_menu_res ul li.hover {
position: static;
color: #555555;
}
.header_menu_res ul li:hover ul ul,
.header_menu_res ul li:hover ul ul ul,
.header_menu_res ul li:hover ul ul ul ul {
left: -999em;
}
.header_menu_res ul li:hover ul,
.header_menu_res ul li li:hover ul,
.header_menu_res ul li li li:hover ul,
.header_menu_res ul li li li li:hover ul {
left: auto;
}
.header_menu_res ul li img.dropdown {
padding: 2px 0 2px 8px;
border: none;
}
.header_menu_res ul.sub-menu {
width: auto;
}
.header_menu_res ul.sub-menu li {
clear: left;
margin: 8px 4px 0;
}
/* category menu */
div#adv_categories,
.header_menu_res ul.sub-menu {
margin: -2px 0 0 0;
padding: 0 0 8px;
position: absolute;
background: #fff;
border: 1px solid #eee;
border-top: none;
z-index: 998;
-webkit-border-radius: 0 6px 6px 6px;
border-radius: 0 6px 6px 6px;
}
div#adv_categories {
display: none;
padding: 0 5px 8px;
}
#menu-header li:hover #adv_categories,
.header_menu .menu li:hover #adv_categories {
display: block;
}
Do the changes like this,
.header_top_res{
width:90%;
}
I can't seem to get the hover to work on my very first css menu navigation button. It is an active li class, does anyone have any ideas? The other menu option' hover effect is working just fine. CSS code:
#import url(http://fonts.googleapis.com/css?family=Open+Sans:600);
/* Menu CSS */#cssmenu,
#cssmenu > ul {
background: url(images/highlight-bg.png) no-repeat;
padding-bottom: 3px;
font-family: 'Open Sans', sans-serif;
font-weight: 600;
left:0px;
top:0px;
}
#cssmenu:before,
#cssmenu:after,
#cssmenu > ul:before,
#cssmenu > ul:after {
content: "";
display: table;
}
#cssmenu:after,
#cssmenu > ul:after {
clear: both;
}
#cssmenu {
width: auto;
zoom: 1;
}
li.space1{
visibility: hidden;
}
li.space2{
visibility: hidden;
}
#cssmenu > ul {
background: url(images/menu-bg.png) no-repeat;
margin: 0;
padding: 0;
position: relative;
}
#cssmenu > ul li {
margin: 0;
padding: 0;
list-style: none;
}
#cssmenu > ul > li {
float: left;
position: relative;
}
#cssmenu > ul > li > a {
padding: 20px 26px;
display: block;
color: white;
font-size: 13px;
text-decoration: none;
text-transform: uppercase;
text-shadow: 0 -1px 0 #9e3825;
text-shadow: 0 -1px 0 rgba(116, 37, 2, 0.7);
line-height: 18px;
margin-right: 10px;
}
#cssmenu > ul > li:hover > a {
background: url(images/hover.png) repeat;
text-shadow: 0 -1px 0 #97321f;
text-shadow: 0 -1px 0 rgba(122, 42, 26, 0.64);
}
#cssmenu > ul > li > a > span {
line-height: 18px;
margin-right: 5px;
}
#cssmenu > ul > li.active > a,
#cssmenu > ul > li > a:active {
background: url(images/active.png) no-repeat;
}
/* Childs */
#cssmenu > ul ul {
opacity: 0;
visibility: hidden;
position: absolute;
top: 120px;
background: url(images/highlight-bg.png) repeat;
margin: 0;
padding: 0;
z-index: -1;
}
#cssmenu > ul li:hover ul {
opacity: 1;
visibility: visible;
margin: 0;
color: #000;
z-index: 2;
top: 52px;
left: 0;
}
#cssmenu > ul ul:before {
content: "";
position: absolute;
top: -10px;
width: 100%;
height: 20px;
background: transparent;
}
#cssmenu > ul ul li {
list-style: none;
padding: 0;
margin: 0;
width: 100%;
}
#cssmenu > ul ul li a {
padding: 18px 26px;
display: block;
color: #393939;
font-size: 13px;
text-decoration: none;
text-transform: uppercase;
width: 150px;
border-left: 4px solid transparent;
text-shadow: 0 1px 0 white;
}
#cssmenu > ul ul li a:hover {
border-left: 4px solid #de553b;
background: url(images/hover.png) repeat;
color: white;
text-shadow: 0 1px 0 black;
}
#cssmenu > ul ul li a:active {
background: url(images/menu-bg.png) no-repeat;
}
#Table_01 {
position:absolute;
left:0px;
top:1px;
width:864px;
height:1px;
visibility: inherit;
}
#DropDown-Design2-11 {
position:absolute;
left:0px;
top:50px;
width:347px;
height:166px;
}
#DropDown-Design2-12 {
position:absolute;
left:347px;
top:50px;
width:103px;
height:142px;
}
#DropDown-Design2-13 {
position:absolute;
left:450px;
top:50px;
width:223px;
height:166px;
}
#DropDown-Design2-14 {
position:absolute;
left:673px;
top:50px;
width:191px;
height:166px;
}
#DropDown-Design2-15 {
position:absolute;
left:347px;
top:192px;
width:103px;
height:24px;
}
Try like this: Demo
If you need mouse over effect for active state then use hover for active li like this:
CSS:
#cssmenu > ul > li:hover > a,#cssmenu > ul > li:hover.active > a {
background:#000 url(images/hover.png) repeat;
text-shadow: 0 -1px 0 #97321f;
text-shadow: 0 -1px 0 rgba(122, 42, 26, 0.64);
}
I want to make my navbar directly in the middle of the page. So as i scroll down the rest of my content appears from beneath. Could someone please help and also explain how to position my background image to fixed so as i scroll the background doesn't move and lose its quality in resolution.
.menu-wrap {
width: 750px;
margin: 0 auto;
list-style: none;
}
/* DROPDOWN */
.ulMenu {
padding: 0;
margin: 0;
}
.navMenu ul {
padding: 0;
margin: 0;
line-height: 30px;
}
navMenu {
padding: 0;
margin: 0;
}
.navMenu li {
list-style-type: none;
padding: 0;
margin: 0;
float: left;
position: relative;
}
.navMenu ul li a {
text-align: center;
padding: 10px;
width: 150px;
height: 30px;
display: block;
color: white;
background-color: rgba(233, 233, 233, 0.5);
text-decoration: none;
border-radius: 0px;
font-family: 'Raleway', sans-serif;
font-size: 20px;
}
.navMenu ul ul {
position: absolute;
visibility: hidden;
}
.navMenu ul li:hover ul {
visibility: visible;
}
.ulMenu .arrow {
font-size: 10px;
}
.navMenu ul li:hover ul li a:hover {
background-color: rgba(93, 93, 93, 0.5);
}
.navMenu li:hover {
background-color: none;
}
.navMenu a:hover {
color: blue;
}
.navMenu ul li ul li {
padding: 2px 0 0 0;
}
.navMenu ul li {
padding: 0 2px 0 0;
}
/* DROPDOWN ENDED */
html {
background-image: url("indexImg.jpg");
background-size: cover;
}
<div class="menu-wrap">
<nav class="navMenu">
<ul class="ulMenu">
<li>Home
</li>
<li>
Products<span class="arrow">▼</span>
<ul>
<li>#
</li>
<li>#
</li>
</ul>
</li>
<li>Contact Us
</li>
<li>About
</li>
</ul>
</nav>
</div>
.menu-wrap {
position: relative;
}
.navMenu {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
I hope this is what u need
Check if it could complete your code
HTML
<nav>
<ul class="nav">
<li>Home</li>
<li>Product
<ul>
<li>item</li>
<li>item</li>
<li>item</li>
<li>item</li>
</ul>
</li>
<li>Contact us
<li>About</li>
CSS
nav {
display: block;
text-align: center;
}
nav ul {
margin: 0;
padding:0;
list-style: none;
}
.nav a {
display:block;
background: #111;
color: #fff;
text-decoration: none;
padding: 0.8em 1.8em;
text-transform: uppercase;
font-size: 80%;
letter-spacing: 2px;
text-shadow: 0 -1px 0 #000;
position: relative;
}
.nav{
vertical-align: top;
display: inline-block;
box-shadow:
1px -1px -1px 1px #000,
-1px 1px -1px 1px #fff,
0 0 6px 3px #fff;
border-radius:6px;
}
.nav li {
position: relative;
}
.nav > li {
float: left;
border-bottom: 4px #aaa solid;
margin-right: 1px;
}
.nav > li > a {
margin-bottom: 1px;
box-shadow: inset 0 2em .33em -0.5em #555;
}
.nav > li:hover,
.nav > li:hover > a {
border-bottom-color: orange;
}
.nav li:hover > a {
color:orange;
}
.nav > li:first-child {
border-radius: 4px 0 0 4px;
}
.nav > li:first-child > a {
border-radius: 4px 0 0 0;
}
.nav > li:last-child {
border-radius: 0 0 4px 0;
margin-right: 0;
}
.nav > li:last-child > a {
border-radius: 0 4px 0 0;
}
.nav li li a {
margin-top: 1px;
}
.nav li a:first-child:nth-last-child(2):before {
content: "";
position: absolute;
height: 0;
width: 0;
border: 5px solid transparent;
top: 50% ;
right:5px;
}
.nav ul {
position: absolute;
white-space: nowrap;
border-bottom: 5px solid orange;
z-index: 1;
left: -99999em;
}
.nav > li:hover > ul {
left: auto;
margin-top: 5px;
min-width: 100%;
}
.nav > li li:hover > ul {
left: 100%;
margin-left: 1px;
top: -1px;
}
/* arrow hover styling */
.nav > li > a:first-child:nth-last-child(2):before {
border-top-color: #aaa;
}
.nav > li:hover > a:first-child:nth-last-child(2):before {
border: 5px solid transparent;
border-bottom-color: orange;
margin-top:-5px
}
.nav li li > a:first-child:nth-last-child(2):before {
border-left-color: #aaa;
margin-top: -5px
}
.nav li li:hover > a:first-child:nth-last-child(2):before {
border: 5px solid transparent;
border-right-color: orange;
right: 10px;
}
I've been trying to solve this problem for quite some time now. I need my navigation to be responsive. By responsive, i need my nav to still show its links when minimized and dragged to the very left. What my code does now is that the links disappear as if there is no nav bar at all when minimized. Thank you in advance!
Normal view (which is also how i need my nav to look like when minimized)
Current minimized window
Here is my drop down menu code for our CSS:
#menu, #menu ul {
margin: 0;
padding: 0;
list-style: none;
}
#menu {
width: 800px;
margin: 60px auto;
margin-top: -30px;
margin-bottom: 10px;
border-top: 1px solid #000;
border-bottom: 1px solid #000;
background-color: #ffffff;/*bg color of drop down menu*/
}
#menu:before,
#menu:after {
content: "";
display: table;
}
#menu:after {
clear: both;
}
#menu {
zoom:1;
}
#menu li {
float: left;
position: relative;
}
#menu a {
float: left;
padding: 12px 30px;
color: #999; /* home my acct etc */
text-transform: uppercase;
font-family: 'Quicksand', sans-serif;
text-decoration: none;
}
#menu li:hover > a { /*font color of nav while hover */
color: #000000;
background: #FFE87C; /* blue */
}
*html #menu li a:hover { /* IE6 only */
color: #000000;
}
#menu ul {
margin: 20px 0 0 0;
_margin: 0; /*IE6 only*/
opacity: 0;
visibility: hidden;
position: absolute;
top: 38px;
left: 0;
z-index: 1;
background:#FFE87C; /* bg color ng drop down yellow */
box-shadow: 0 -1px 0 rgba(255,255,255,.3);
border-radius: 3px;
transition: all .2s ease-in-out;
}
#menu li:hover > ul {
opacity: 1;
visibility: visible;
margin: 0;
}
#menu ul ul {
top: 0;
left: 150px;
margin: 0 0 0 20px;
_margin: 0; /*IE6 only*/
box-shadow: -1px 0 0 rgba(255,255,255,.3);
}
#menu ul li {
float: none;
display: block;
border: 0;
_line-height: 0; /*IE6 only*/
}
#menu ul li:last-child {
-moz-box-shadow: none;
-webkit-box-shadow: none;
box-shadow: none;
}
#menu ul a {
padding: 10px;
width: auto;
_height: 10px; /*IE6 only*/
display: block;
white-space: nowrap;
float: none;
text-transform: none;
color: black; /* font color of drop down */
}
#menu ul a:hover {
background-color: #EDDA74;/*hover of link blue*/
color:#000000;
}
#menu ul li:first-child > a {
border-radius: 3px 3px 0 0;
}
#menu ul li:first-child > a:after {
content: '';
position: absolute;
left: 40px;
top: -6px;
border-left: 6px solid transparent;
border-right: 6px solid transparent;
border-bottom: 6px solid #D1D0CE;
}
#menu ul ul li:first-child a:after {
left: -6px;
top: 50%;
margin-top: -6px;
border-left: 0;
border-bottom: 6px solid transparent;
border-top: 6px solid transparent;
border-right: 6px solid #D1D0CE;
}
#menu ul li:first-child a:hover:after {
border-bottom-color: #04acec;
}
#menu ul ul li:first-child a:hover:after {
border-right-color: #0299d3;
border-bottom-color: transparent;
}
#menu ul li:last-child > a {
-moz-border-radius: 0 0 3px 3px;
-webkit-border-radius: 0 0 3px 3px;
border-radius: 0 0 3px 3px;
}
#media screen and (max-width: 600px) {
/* nav-wrap */
#menu-wrap {
position: relative;
}
#menu-wrap * {
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
/* menu icon */
#menu-trigger {
display: block; /* show menu icon */
height: 40px;
line-height: 40px;
cursor: pointer;
padding: 0 0 0 35px;
border: 1px solid #222;
color: #fafafa;
background-color: #111;
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAAPCAMAAADeWG8gAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyBpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBXaW5kb3dzIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjE2QjAxNjRDOUNEOTExRTE4RTNFRkI1RDQ2MUYxOTQ3IiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOjE2QjAxNjREOUNEOTExRTE4RTNFRkI1RDQ2MUYxOTQ3Ij4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6MTZCMDE2NEE5Q0Q5MTFFMThFM0VGQjVENDYxRjE5NDciIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6MTZCMDE2NEI5Q0Q5MTFFMThFM0VGQjVENDYxRjE5NDciLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz42AEtnAAAABlBMVEX///////9VfPVsAAAAAnRSTlP/AOW3MEoAAAAWSURBVHjaYmAgFzBiACKFho6NAAEGAD07AG1pn932AAAAAElFTkSuQmCC) no-repeat 10px center, linear-gradient(#444, #111);
border-radius: 6px;
box-shadow: 0 1px 1px #777, 0 1px 0 #666 inset;
}
/* main nav */
#menu {
margin: 0; padding: 10px;
position: absolute;
top: 40px;
width: 100%;
z-index: 1;
background-color: #48CCCD;
display: none;
box-shadow: none;
}
#menu:after {
content: '';
position: absolute;
left: 25px;
top: -8px;
border-left: 8px solid transparent;
border-right: 8px solid transparent;
border-bottom: 8px solid #444;
}
#menu ul {
position: static;
visibility: visible;
opacity: 1;
margin: 0;
background: none;
box-shadow: none;
}
#menu ul ul {
margin: 0 0 0 20px !important;
box-shadow: none;
}
#menu li {
position: static;
display: block;
float: none;
border: 0;
margin: 5px;
box-shadow: none;
}
#menu ul li{
margin-left: 20px;
box-shadow: none;
}
#menu a{
display: block;
float: none;
padding: 0;
color: #999;
}
#menu a:hover{
color: #fafafa;
}
#menu ul a{
padding: 0;
width: auto;
}
#menu ul a:hover{
background: none;
}
#menu ul li:first-child a:after,
#menu ul ul li:first-child a:after {
border: 0;
}
}
I think you should try to set the "html, body" tags in your CSS with min-width: x% / xpx, x being your choice, e.g. min-width: 700px or min-width: 75%
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;
}