How to centre a navigation bar? - html

I am making a navigation bar for my website.
I want it to be centered. Here's my style and HTML files.
#import url(http://fonts.googleapis.com/css?family=Open+Sans:400,700);
#cssmenu,
#cssmenu ul,
#cssmenu ul li,
#cssmenu ul li a,
#cssmenu #menu-button {
margin: 0;
padding: 0;
border: 0;
list-style: none;
line-height: 1;
display: block;
position: relative;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
#cssmenu:after,
#cssmenu > ul:after {
content: ".";
display: block;
clear: both;
visibility: hidden;
line-height: 0;
height: 0;
}
#cssmenu #menu-button {
display: none;
}
#nav ul {
display: inline-block;
list-style-type: none;
}
#cssmenu {
width: auto;
font-family: 'Comic Sans Ms', Helvetica, sans-serif;
background: #39b1cc;
background: -moz-linear-gradient(top, #51bbd2 0%, #2d97af 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #51bbd2), color-stop(100%, #2d97af));
background: -webkit-linear-gradient(top, #51bbd2 0%, #2d97af 100%);
background: -o-linear-gradient(top, #51bbd2 0%, #2d97af 100%);
background: -ms-linear-gradient(top, #51bbd2 0%, #2d97af 100%);
background: linear-gradient(to bottom, #51bbd2 0%, #2d97af 100%);
}
#cssmenu > ul {
background: url('images/bg.png');
box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.05);
}
#cssmenu.align-right > ul > li {
float: right;
}
#cssmenu > ul > li {
float: left;
display: inline-block;
}
#cssmenu.align-center > ul {
float: none;
text-align: center;
}
#cssmenu.align-center > ul > li {
float: none;
}
#cssmenu.align-center ul ul {
text-align: left;
}
#cssmenu > ul > li > a {
padding: 18px 25px 21px 25px;
border-right: 1px solid rgba(80, 80, 80, 0.12);
text-decoration: none;
font-size: 15px;
font-weight: 700;
color: #d3eced;
text-transform: uppercase;
letter-spacing: 1px;
}
#cssmenu > ul > li:hover > a,
#cssmenu > ul > li > a:hover,
#cssmenu > ul > li.active > a {
color: #ffffff;
background: #32a9c3;
background: rgba(0, 0, 0, 0.1);
}
#cssmenu > ul > li.has-sub > a {
padding-right: 45px;
}
#cssmenu > ul > li.has-sub > a::after {
content: "";
position: absolute;
width: 0;
height: 0;
border: 6px solid transparent;
border-top-color: #d3eced;
right: 17px;
top: 22px;
}
#cssmenu > ul > li.has-sub.active > a::after,
#cssmenu > ul > li.has-sub:hover > a {
border-top-color: #ffffff;
}
#cssmenu ul ul {
position: absolute;
left: -9999px;
top: 60px;
padding-top: 6px;
font-size: 13px;
opacity: 0;
-webkit-transition: top 0.2s ease, opacity 0.2s ease-in;
-moz-transition: top 0.2s ease, opacity 0.2s ease-in;
-ms-transition: top 0.2s ease, opacity 0.2s ease-in;
-o-transition: top 0.2s ease, opacity 0.2s ease-in;
transition: top 0.2s ease, opacity 0.2s ease-in;
}
#cssmenu.align-right ul ul {
text-align: right;
}
#cssmenu > ul > li > ul::after {
content: "";
position: absolute;
width: 0;
height: 0;
border: 5px solid transparent;
border-bottom-color: #ffffff;
top: -4px;
left: 20px;
}
#cssmenu.align-right > ul > li > ul::after {
left: auto;
right: 20px;
}
#cssmenu ul ul ul::after {
content: "";
position: absolute;
width: 0;
height: 0;
border: 5px solid transparent;
border-right-color: #ffffff;
top: 11px;
left: -4px;
}
#cssmenu.align-right ul ul ul::after {
border-right-color: transparent;
border-left-color: #ffffff;
left: auto;
right: -4px;
}
#cssmenu > ul > li > ul {
top: 120px;
}
#cssmenu > ul > li:hover > ul {
top: 52px;
left: 0;
opacity: 1;
}
#cssmenu.align-right > ul > li:hover > ul {
left: auto;
right: 0;
}
#cssmenu ul ul ul {
padding-top: 0;
padding-left: 6px;
}
#cssmenu.align-right ul ul ul {
padding-right: 6px;
}
#cssmenu ul ul > li:hover > ul {
left: 180px;
top: 0;
opacity: 1;
}
#cssmenu.align-right ul ul > li:hover > ul {
left: auto;
right: 100%;
opacity: 1;
}
#cssmenu ul ul li a {
text-decoration: none;
font-weight: 400;
padding: 11px 25px;
width: 180px;
color: #777777;
background: #ffffff;
box-shadow: 0 2px 2px rgba(0, 0, 0, 0.1), 1px 1px 1px rgba(0, 0, 0, 0.1), -1px 1px 1px rgba(0, 0, 0, 0.1);
}
#cssmenu ul ul li:hover > a,
#cssmenu ul ul li.active > a {
color: #333333;
}
#cssmenu ul ul li:first-child > a {
border-top-left-radius: 3px;
border-top-right-radius: 3px;
}
#cssmenu ul ul li:last-child > a {
border-bottom-left-radius: 3px;
border-bottom-right-radius: 3px;
}
#cssmenu > ul > li > ul::after {
position: absolute;
display: block;
}
#cssmenu ul ul li.has-sub > a::after {
content: "";
position: absolute;
width: 0;
height: 0;
border: 4px solid transparent;
border-left-color: #777777;
right: 17px;
top: 14px;
}
#cssmenu.align-right ul ul li.has-sub > a::after {
border-left-color: transparent;
border-right-color: #777777;
right: auto;
left: 17px;
}
#cssmenu ul ul li.has-sub.active > a::after,
#cssmenu ul ul li.has-sub:hover > a::after {
border-left-color: #333333;
}
#cssmenu.align-right ul ul li.has-sub.active > a::after,
#cssmenu.align-right ul ul li.has-sub:hover > a::after {
border-right-color: #333333;
border-left-color: transparent;
}
#media all and (max-width: 800px), only screen and (-webkit-min-device-pixel-ratio: 2) and (max-width: 1024px), only screen and (min--moz-device-pixel-ratio: 2) and (max-width: 1024px), only screen and (-o-min-device-pixel-ratio: 2/1) and (max-width: 1024px), only screen and (min-device-pixel-ratio: 2) and (max-width: 1024px), only screen and (min-resolution: 192dpi) and (max-width: 1024px), only screen and (min-resolution: 2dppx) and (max-width: 1024px) {
#cssmenu {
background: #39b1cc;
}
#cssmenu > ul {
display: none;
}
#cssmenu > ul.open {
display: block;
border-top: 1px solid rgba(0, 0, 0, 0.1);
}
#cssmenu.align-right > ul {
float: none;
}
#cssmenu.align-center > ul {
text-align: left;
}
#cssmenu > ul > li,
#cssmenu.align-right > ul > li {
float: none;
display: block;
}
#cssmenu > ul > li > a {
padding: 18px 25px 18px 25px;
border-right: 0;
}
#cssmenu > ul > li:hover > a,
#cssmenu > ul > li.active > a {
background: rgba(0, 0, 0, 0.1);
}
#cssmenu #menu-button {
display: block;
text-decoration: none;
font-size: 13px;
font-weight: 700;
color: #d3eced;
padding: 18px 25px 18px 25px;
text-transform: uppercase;
letter-spacing: 1px;
background: url('images/bg.png');
cursor: pointer;
}
#cssmenu ul ul,
#cssmenu ul li:hover > ul,
#cssmenu > ul > li > ul,
#cssmenu ul ul ul,
#cssmenu ul ul li:hover > ul,
#cssmenu.align-right ul ul,
#cssmenu.align-right ul li:hover > ul,
#cssmenu.align-right > ul > li > ul,
#cssmenu.align-right ul ul ul,
#cssmenu.align-right ul ul li:hover > ul {
left: 0;
right: auto;
top: auto;
opacity: 1;
width: 100%;
padding: 0;
position: relative;
text-align: left;
}
#cssmenu ul ul li {
width: 100%;
}
#cssmenu ul ul li a {
width: 100%;
box-shadow: none;
padding-left: 35px;
}
#cssmenu ul ul ul li a {
padding-left: 45px;
}
#cssmenu ul ul li:first-child > a,
#cssmenu ul ul li:last-child > a {
border-radius: 0;
}
#cssmenu #menu-button::after {
display: block;
content: '';
position: absolute;
height: 3px;
width: 22px;
border-top: 2px solid #d3eced;
border-bottom: 2px solid #d3eced;
right: 25px;
top: 18px;
}
#cssmenu #menu-button::before {
display: block;
content: '';
position: absolute;
height: 3px;
width: 22px;
border-top: 2px solid #d3eced;
right: 25px;
top: 28px;
}
#cssmenu > ul > li.has-sub > a::after,
#cssmenu ul ul li.has-sub > a::after {
display: none;
}
}
<html>
<head>
<meta charset='utf-8'>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="styles.css">
<script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script>
<script src="script.js"></script>
<title>Hugo de Heer</title>
</head>
<body>
<body background="images/background.png">
<div style="text-align: center;">
<IMG SRC="images/logo.png" ALT="image"></div>
<div id='cssmenu'>
<ul>
<li><a href='#'><span>Home</span></a></li>
<li class='has-sub'><a href='#'><span>Algemeen</span></a>
<ul>
<li class='#'><a href='#'><span>Over mijzelf</span></a></li>
<li class='#'><a href='#'><span>Mijn hond</span></a>
</li>
</ul>
</li>
<li class='has-sub'><a href='#'><span>Hobby's</span></a>
<ul>
<li class='has-sub'><a href='#'><span>Gamen</span></a>
<ul>
<li class='#'><a href='#'><span>Playstation 4</span></a></li>
<li class='#'><a href='#'><span>Pc Games</span></a></li>
</li>
</ul>
</li>
<li class='has-sub'><a href='#'><span>Sport</span></a>
<ul>
<li class='#'><a href='#'><span>Voetbal</span></a></li>
<li class='#'><a href='#'><span>Tafeltennis</span></a></li>
</li>
</ul> </ul>
</li>
<li class='has-sub'><a href='#'><span>Vakantie</span></a>
<ul>
<li class='#'><a href='#'><span>Veluwe</span></a></li>
<li class='#'><a href='#'><span>België en Duitsland</span></a>
</li>
</ul>
</li>
<li class='has-sub'><a href='#'><span>Muziek</span></a>
<ul>
<li class='#'><a href='#'><span>Orgel</span></a></li>
<li class='#'><a href='#'><span>Trommelen vroeger</span></a>
</li>
</ul>
</li>
</div>
</body>
</html>

Remove float: none; from li and then set text-align:center; to their parent
#cssmenu > ul > li
{
float: none;
}
#cssmenu > ul
{
text-align: center;
}
Jsfiddle

Try This Code use of Flex-
#cssmenu > ul {
background: transparent url("images/bg.png") repeat scroll 0% 0%;
box-shadow: 0px -3px 0px rgba(0, 0, 0, 0.05) inset;
justify-content: center;
/*new*/
-webkit-flex-align: center;
-ms-flex-align: center;
-webkit-align-items: center;
align-items: center;
-ms-flex-pack: center;
display: -webkit-box;
/* OLD - iOS 6-, Safari 3.1-6 */
display: -moz-box;
/* OLD - Firefox 19- (buggy but mostly works) */
display: -ms-flexbox;
/* TWEENER - IE 10 */
display: -webkit-flex;
/* NEW - Chrome */
display: flex;
/* NEW, Spec - Opera 12.1, Firefox 20+ */
text-align:center;
}

Related

Sub Sub Menu Code Broken?

Not sure where I am going wrong. Can't seem to get my Sub Sub Menu to display under the "Supai" tab. Where am I going wrong? I can get the Sub Menu to work, but somehow the Sub Sub will not display. Ugh
Also, I am sure you are tired of these Sub Sub Menu questions. I've dug through them and have even used the exact code used in responses on this website. They work fine.....until I paste them into my blog on blogger. Thinking there may be something working against me within the Blogger code itself. Thoughts?
#cssnav {
float: left;
font: bold 12px Verdana, Helvetica, Sans-serif;
border: 2px solid #74BA94;
border-top: 1px solid #747BBA;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
overflow: hidden;
}
#cssnav ul {
margin:0;
padding:0;
list-style:none;
}
#cssnav ul li {
float:left;
}
#cssnav ul li a {
float: left;
color:#EA1047;
padding: 10px 20px;
text-decoration:none;
background:#3F10EA;
background: -webkit-gradient( linear, left bottom, left top, color-stop(0.09, rgb(59,63,65)), color-stop(0.55, rgb(72,76,77)), color-stop(0.78, rgb(75,77,77)) );
background: -moz-linear-gradient( center bottom, rgb(59,63,65) 9%, rgb(72,76,77) 55%, rgb(75,77,77) 78% );
background: -o-linear-gradient( center bottom, rgb(59,63,65) 9%, rgb(72,76,77) 55%, rgb(75,77,77) 78% );
box-shadow: 0 1px 0 rgba(255, 255, 255, 0.1) inset, 0 0 5px rgba(0, 0, 0, 0.1) inset;
border-left: 1px solid rgba(255, 255, 255, 0.05);
border-right: 1px solid rgba(0,0,0,0.2);
text-shadow: 0 -1px 1px rgba(0, 0, 0, 0.6);
}
#cssnav ul li a:hover,
#cssnav ul li:hover > a {
color: #252525;
background:#3C4042;
background: -webkit-gradient( linear, left bottom, left top, color-stop(0.09, rgb(77,79,79)), color-stop(0.55, rgb(67,70,71)), color-stop(0.78, rgb(69,70,71)) );
background: -moz-linear-gradient( center bottom, rgb(77,79,79) 9%, rgb(67,70,71) 55%, rgb(69,70,71) 78% );
background: -o-linear-gradient( center bottom, rgb(77,79,79) 9%, rgb(67,70,71) 55%, rgb(69,70,71) 78% );
text-shadow: 0 1px 0 rgba(255, 255, 255, 0.2), 0 -1px #000;
}
#cssnav li ul a:hover,
#cssnav ul li li:hover > a {
color: #2c2c2c;
background: #5C9ACD;
background: -webkit-gradient( linear, left bottom, left top, color-stop(0.17, rgb(61,111,177)), color-stop(0.51, rgb(80,136,199)), color-stop(1, rgb(92,154,205)) );
background: -moz-linear-gradient( center bottom, rgb(61,111,177) 17%, rgb(80,136,199) 51%, rgb(92,154,205) 100% );
background: -o-linear-gradient( center bottom, rgb(61,111,177) 17%, rgb(80,136,199) 51%, rgb(92,154,205) 100% );
border-bottom: 1px solid rgba(0,0,0,0.6);
border-top: 1px solid #7BAED9;
text-shadow: 0 1px rgba(255, 255, 255, 0.3);
}
#cssnav li ul {
background:#3C4042;
background-image: -webkit-gradient( linear, left bottom, left top, color-stop(0.09, rgb(77,79,79)), color-stop(0.55, rgb(67,70,71)), color-stop(0.78, rgb(69,70,71)) );
background-image: -moz-linear-gradient( center bottom, rgb(77,79,79) 9%, rgb(67,70,71) 55%, rgb(69,70,71) 78% );
background-image: -o-linear-gradient( center bottom, rgb(77,79,79) 9%, rgb(67,70,71) 55%, rgb(69,70,71) 78% );
border-radius: 0 0 10px 10px;
-moz-border-radius: 0 0 10px 10px;
-webkit-border-radius: 0 0 10px 10px;
left: -999em;
margin: 35px 0 0;
position: absolute;
width: 160px;
z-index: 9999;
box-shadow: 0 0 15px rgba(0, 0, 0, 0.4) inset;
-moz-box-shadow: 0 0 15px rgba(0, 0, 0, 0.4) inset;
-webkit-box-shadow: 0 0 15px rgba(0, 0, 0, 0.4) inset;
border: 1px solid rgba(0, 0, 0, 0.5);
}
#cssnav li:hover ul {
left: auto;
}
#cssnav li ul a {
background: none;
border: 0 none;
margin-right: 0;
width: 120px;
box-shadow: none;
-moz-box-shadow: none;
-webkit-box-shadow: none;
border-bottom: 1px solid transparent;
border-top: 1px solid transparent;
}
#cssnav li li ul {
margin: -1px 0 0 160px;
-webkit-border-radius: 0 10px 10px 10px;
-moz-border-radius: 0 10px 10px 10px;
border-radius: 0 10px 10px 10px;
visibility:hidden;
}
#cssnav li li:hover ul {
visibility:visible;
}
#cssnav ul ul li:last-child > a {
-moz-border-radius:0 0 10px 10px;
-webkit-border-radius:0 0 10px 10px;
border-radius:0 0 10px 10px;
}
#cssnav li:hover ul ul {
display:none; // hide the unordered list that is inside the unordered list
}
#cssnav li ul li:hover ul {
display:block; // display the unordered list in the same way as your sub menu
}
#cssnav ul ul ul li:first-child > a {
-moz-border-radius:0 10px 0 0;
-webkit-border-radius:0 10px 0 0;
border-radius:0 10px 0 0;
}
<!doctype html>
<div id="cssnav">
<ul>
<li>Home</li>
<li>About Me</li>
<li>JOC: Book Series</li>
<li>Adventures
<ul>
<li>Supai</li>
<ul>
<li>Supai Walkthrough</li>
<li>The Drive</li>
<li>Hilltop</li>
<li>VillageTrek</li>
<li>Village</li>
<li>Navajo Falls</li>
<li>Havasu Falls</li>
<li>Campground</li>
<li>Mooney Falls</li>
<li>Beaver Trek</li>
<li>Beaver Falls</li>
<li>Colorado River Trek</li>
<li>Colorado River</li>
</ul>
<li>Never Summer Wilderness</li>
<li>Red River Gorge</li>
<li>Yellowstone</li>
<li>Sequoia Nat'l Park</li>
</ul>
<li>Contest</li>
<li>Fire Basics
</li></li></ul>
</div>
</!doctype>
Every submenu ul has to be inside of an li element of the higher level menu, so this code...
<li>Supai</li>
<ul>
<li>Supai Walkthrough</li>
<li>The Drive</li>
[ etc. ]
<li>Colorado River</li>
</ul>
...should be
<li>Supai
<ul>
<li>Supai Walkthrough</li>
<li>The Drive</li>
[ etc. ]
<li>Colorado River</li>
</ul>
</li>
(moved closing li tag)
place your sub submenu (contained in another ul tag) within the list tag and style as follows:
#cssnav ul li:hover #cssnav ul li ul li{
left:100%;
overflow:visible;
top: 0px;
margin: 0px;
left: 100%;
}
#cssnav ul li ul:hover {
visibility:visible;
overflow:visible;
}
click here for demo
$("#cssmenu").menumaker({
title: "Menu",
breakpoint: 768,
format: "multitoggle"
});
#import url(https://fonts.googleapis.com/css?family=Montserrat:400,700);
#cssmenu,
#cssmenu ul,
#cssmenu ul li,
#cssmenu ul li a,
#cssmenu #menu-button {
margin: 0;
padding: 0;
border: 0;
list-style: none;
line-height: 1;
display: block;
position: relative;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
#cssmenu:after,
#cssmenu > ul:after {
content: ".";
display: block;
clear: both;
visibility: hidden;
line-height: 0;
height: 0;
}
#cssmenu #menu-button {
display: none;
}
#cssmenu {
font-family: Montserrat, sans-serif;
background: #3b3f41;
}
#cssmenu > ul > li {
float: left;
}
#cssmenu.align-center > ul {
font-size: 0;
text-align: center;
}
#cssmenu.align-center > ul > li {
display: inline-block;
float: none;
}
#cssmenu.align-center ul ul {
text-align: left;
}
#cssmenu.align-right > ul > li {
float: right;
}
#cssmenu > ul > li > a {
padding: 17px;
font-size: 12px;
letter-spacing: 1px;
text-decoration: none;
color: #ef547b;
font-weight: 700;
text-transform: uppercase;
}
#cssmenu > ul > li:hover > a {
color: #cccccc;
}
#cssmenu > ul > li.has-sub > a {
padding-right: 30px;
}
#cssmenu > ul > li.has-sub > a:after {
position: absolute;
top: 22px;
right: 11px;
width: 8px;
height: 2px;
display: block;
background: #ef547b;
content: '';
}
#cssmenu > ul > li.has-sub > a:before {
position: absolute;
top: 19px;
right: 14px;
display: block;
width: 2px;
height: 8px;
background: #ef547b;
content: '';
-webkit-transition: all .25s ease;
-moz-transition: all .25s ease;
-ms-transition: all .25s ease;
-o-transition: all .25s ease;
transition: all .25s ease;
}
#cssmenu > ul > li.has-sub:hover > a:before {
top: 23px;
height: 0;
}
#cssmenu ul ul {
position: absolute;
left: -9999px;
}
#cssmenu.align-right ul ul {
text-align: right;
}
#cssmenu ul ul li {
height: 0;
-webkit-transition: all .25s ease;
-moz-transition: all .25s ease;
-ms-transition: all .25s ease;
-o-transition: all .25s ease;
transition: all .25s ease;
}
#cssmenu li:hover > ul {
left: auto;
}
#cssmenu.align-right li:hover > ul {
left: auto;
right: 0;
}
#cssmenu li:hover > ul > li {
height: 35px;
}
#cssmenu ul ul ul {
margin-left: 100%;
top: 0;
}
#cssmenu.align-right ul ul ul {
margin-left: 0;
margin-right: 100%;
}
#cssmenu ul ul li a {
border-bottom: 1px solid rgba(150, 150, 150, 0.15);
padding: 11px 15px;
width: 170px;
font-size: 12px;
text-decoration: none;
color: #dddddd;
font-weight: 400;
background: #333333;
}
#cssmenu ul ul li:last-child > a,
#cssmenu ul ul li.last-item > a {
border-bottom: 0;
}
#cssmenu ul ul li:hover > a,
#cssmenu ul ul li a:hover {
color: #99cdf5;
}
#cssmenu ul ul li.has-sub > a:after {
position: absolute;
top: 16px;
right: 11px;
width: 8px;
height: 2px;
display: block;
background: #dddddd;
content: '';
}
#cssmenu.align-right ul ul li.has-sub > a:after {
right: auto;
left: 11px;
}
#cssmenu ul ul li.has-sub > a:before {
position: absolute;
top: 13px;
right: 14px;
display: block;
width: 2px;
height: 8px;
background: #dddddd;
content: '';
-webkit-transition: all .25s ease;
-moz-transition: all .25s ease;
-ms-transition: all .25s ease;
-o-transition: all .25s ease;
transition: all .25s ease;
}
#cssmenu.align-right ul ul li.has-sub > a:before {
right: auto;
left: 14px;
}
#cssmenu ul ul > li.has-sub:hover > a:before {
top: 17px;
height: 0;
}
#cssmenu.small-screen {
width: 100%;
}
#cssmenu.small-screen ul {
width: 100%;
display: none;
}
#cssmenu.small-screen.align-center > ul {
text-align: left;
}
#cssmenu.small-screen ul li {
width: 100%;
border-top: 1px solid rgba(120, 120, 120, 0.2);
}
#cssmenu.small-screen ul ul li,
#cssmenu.small-screen li:hover > ul > li {
height: auto;
}
#cssmenu.small-screen ul li a,
#cssmenu.small-screen ul ul li a {
width: 100%;
border-bottom: 0;
}
#cssmenu.small-screen > ul > li {
float: none;
}
#cssmenu.small-screen ul ul li a {
padding-left: 25px;
}
#cssmenu.small-screen ul ul ul li a {
padding-left: 35px;
}
#cssmenu.small-screen ul ul li a {
color: #ef547b;
background: none;
}
#cssmenu.small-screen ul ul li:hover > a,
#cssmenu.small-screen ul ul li.active > a {
color: #cccccc;
}
#cssmenu.small-screen ul ul,
#cssmenu.small-screen ul ul ul,
#cssmenu.small-screen.align-right ul ul {
position: relative;
left: 0;
width: 100%;
margin: 0;
text-align: left;
}
#cssmenu.small-screen > ul > li.has-sub > a:after,
#cssmenu.small-screen > ul > li.has-sub > a:before,
#cssmenu.small-screen ul ul > li.has-sub > a:after,
#cssmenu.small-screen ul ul > li.has-sub > a:before {
display: none;
}
#cssmenu.small-screen #menu-button {
display: block;
padding: 17px;
color: #ef547b;
cursor: pointer;
font-size: 12px;
text-transform: uppercase;
font-weight: 700;
}
#cssmenu.small-screen #menu-button:after {
position: absolute;
top: 22px;
right: 17px;
display: block;
height: 4px;
width: 20px;
border-top: 2px solid #ef547b;
border-bottom: 2px solid #ef547b;
content: '';
box-sizing: content-box;
}
#cssmenu.small-screen #menu-button:before {
position: absolute;
top: 16px;
right: 17px;
display: block;
height: 2px;
width: 20px;
background: #ef547b;
content: '';
box-sizing: content-box;
}
#cssmenu.small-screen #menu-button.menu-opened:after {
top: 23px;
border: 0;
height: 2px;
width: 15px;
background: #cccccc;
-webkit-transform: rotate(45deg);
-moz-transform: rotate(45deg);
-ms-transform: rotate(45deg);
-o-transform: rotate(45deg);
transform: rotate(45deg);
}
#cssmenu.small-screen #menu-button.menu-opened:before {
top: 23px;
background: #cccccc;
width: 15px;
-webkit-transform: rotate(-45deg);
-moz-transform: rotate(-45deg);
-ms-transform: rotate(-45deg);
-o-transform: rotate(-45deg);
transform: rotate(-45deg);
}
#cssmenu.small-screen .submenu-button {
position: absolute;
z-index: 99;
right: 0;
top: 0;
display: block;
border-left: 1px solid rgba(120, 120, 120, 0.2);
height: 46px;
width: 46px;
cursor: pointer;
}
#cssmenu.small-screen .submenu-button.submenu-opened {
background: #2f3234;
}
#cssmenu.small-screen ul ul .submenu-button {
height: 34px;
width: 34px;
}
#cssmenu.small-screen .submenu-button:after {
position: absolute;
top: 22px;
right: 19px;
width: 8px;
height: 2px;
display: block;
background: #ef547b;
content: '';
}
#cssmenu.small-screen ul ul .submenu-button:after {
top: 15px;
right: 13px;
}
#cssmenu.small-screen .submenu-button.submenu-opened:after {
background: #cccccc;
}
#cssmenu.small-screen .submenu-button:before {
position: absolute;
top: 19px;
right: 22px;
display: block;
width: 2px;
height: 8px;
background: #ef547b;
content: '';
}
#cssmenu.small-screen ul ul .submenu-button:before {
top: 12px;
right: 16px;
}
#cssmenu.small-screen .submenu-button.submenu-opened:before {
display: none;
}
#cssmenu.small-screen.select-list {
padding: 5px;
}
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- jQuery -->
<script src="http://code.jquery.com/jquery-latest.min.js"></script>
<!-- MenuMaker Plugin -->
<script src="https://s3.amazonaws.com/menumaker/menumaker.min.js"></script>
<!-- Icon Library -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<div id="cssmenu">
<ul>
<li><i class="fa fa-fw fa-home"></i> Home</li>
<li>About me</li>
<li>JOC: Book Series</li>
<li><i class="fa fa-fw fa-cog"></i> Adventures
<ul>
<li>Supai
<ul>
<li>Supai Walkthrough</li>
<li>The Drive</li>
<li>Hilltop</li>
<li>VillageTrek</li>
<li>Village</li>
<li>Navajo Falls</li>
<li>Havasu Falls</li>
<li>Campground</li>
<li>Mooney Falls</li>
<li>Beaver Trek</li>
<li>Beaver Falls</li>
<li>Colorado River Trek</li>
<li>Colorado River</li>
</ul>
</li>
<li>Never Summer Wilderness</li>
<li>Red River Gorge</li>
<li>Yellowstone</li>
<li>Sequoia Nat'l Park</li>
</ul>
</li>
<li>Contest</li>
<li>Fire Basics</li>
</ul>
</div>
</body>
</html>

I want to open submenu on hover of menu item, but it's not opening

Hi I am making menu and submenu. I want to open submenu on hover of menu item, but it's not opening! it was wondering if you could help me on this
.womendress: hover > .menu1 {
display: block;
}
.menu1 {
display: none;
position: relative;
float: right;
width: 500%;
height: 300px;
right: 0px;
top : 50px;
z-index: 10;
}
<nav>
<ul>
<li class="womendress"> پوشاک زنانه
<ul class="menu1">
<li class="tshirt">تیشرت </li>
<li>شلوار</li>
<li>پیراهن</li>
<li>سارافون</li>
</ul>
</li>
<li> تخفیفات </li>
</ul>
</nav>
You have a space between .womandress: and hover in the hover rule - remove that. Apart from that the settings for the submenu look a bit impractical... (should have position: absolute, no float, less width etc. etc.)
#charset "UTF-8";
/* Base Styles */
#cssmenu > ul,
#cssmenu > ul li,
#cssmenu > ul ul {
list-style: none;
margin: 0;
padding: 0;
}
#cssmenu > ul {
position: relative;
z-index: 597;
}
#cssmenu > ul li {
float: left;
min-height: 1px;
line-height: 1.3em;
vertical-align: middle;
}
#cssmenu > ul li.hover,
#cssmenu > ul li:hover {
position: relative;
z-index: 599;
cursor: default;
}
#cssmenu > ul ul {
visibility: hidden;
position: absolute;
top: 100%;
left: 0;
z-index: 598;
width: 100%;
}
#cssmenu > ul ul li {
float: none;
}
#cssmenu > ul ul ul {
top: 1px;
left: 99%;
}
#cssmenu > ul li:hover > ul {
visibility: visible;
}
/* Align last drop down RTL */
#cssmenu > ul > li.last ul ul {
left: auto !important;
right: 99%;
}
#cssmenu > ul > li.last ul {
left: auto;
right: 0;
}
#cssmenu > ul > li.last {
text-align: right;
}
#cssmenu.align-center > ul > li {
float: none;
display: inline-block;
}
#cssmenu.align-center > ul {
text-align: center;
font-size: 0;
}
#cssmenu > ul > li {
font-size: 14px;
display: block;
}
#cssmenu ul ul {
text-align: left;
}
#cssmenu.align-right > ul > li {
float: right;
}
#cssmenu.align-right > ul ul ul {
top: 1px;
left: auto;
right: 99%;
}
/* Theme Styles */
#cssmenu > ul {
border-top: 4px solid #3fa338;
font-family: Calibri, Tahoma, Arial, sans-serif;
background: #1e1e1e;
background: -moz-linear-gradient(top, #1e1e1e 0%, #040404 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #1e1e1e), color-stop(100%, #040404));
background: -webkit-linear-gradient(top, #1e1e1e 0%, #040404 100%);
background: linear-gradient(top, #1e1e1e 0%, #040404 100%);
width: auto;
zoom: 1;
}
#cssmenu > ul:before {
content: '';
display: block;
}
#cssmenu > ul:after {
content: '';
display: table;
clear: both;
}
#cssmenu > ul li a {
display: inline-block;
padding: 10px 22px;
}
#cssmenu > ul > li.active,
#cssmenu > ul > li.active:hover {
background-color: #3fa338;
}
#cssmenu > ul > li > a:link,
#cssmenu > ul > li > a:active,
#cssmenu > ul > li > a:visited {
color: white;
}
#cssmenu > ul > li > a:hover {
color: white;
}
#cssmenu > ul ul ul {
top: 0;
}
#cssmenu > ul li li {
background-color: white;
border-bottom: 1px solid #EBEBEB;
font-size: 12px;
}
#cssmenu > ul li.hover,
#cssmenu > ul li:hover {
background-color: #F5F5F5;
}
#cssmenu > ul > li.hover,
#cssmenu > ul > li:hover {
background-color: #3fa338;
-webkit-box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.15);
-moz-box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.15);
box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.15);
}
#cssmenu > ul a:link,
#cssmenu > ul a:visited {
color: #9A9A9A;
text-decoration: none;
}
#cssmenu > ul a:hover {
color: #9A9A9A;
}
#cssmenu > ul a:active {
color: #9A9A9A;
}
#cssmenu > ul > li > a {
font-size: 14px;
}
#cssmenu > ul ul {
border: 1px solid #CCC \9;
-webkit-box-shadow: 0 0px 2px 1px rgba(0, 0, 0, 0.15);
-moz-box-shadow: 0 0px 2px 1px rgba(0, 0, 0, 0.15);
box-shadow: 0 0px 2px 1px rgba(0, 0, 0, 0.15);
width: 150px;
}
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Icon Library -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<div id="cssmenu" class="align-right">
<ul>
<li class="active"><i class="fa fa-fw fa-home"></i> Home</li>
<li><i class="fa fa-fw fa-bars"></i> پوشاک زنانه
<ul>
<li>تیشرت
<ul>
<li>S</li>
<li>M</li>
<li>L</li>
</ul>
</li>
<li>شلوار
<ul>
<li>S</li>
<li>M</li>
<li>L</li>
</ul>
</li>
<li>پیراهن
<ul>
<li>S</li>
<li>M</li>
<li>L</li>
</ul>
</li>
<li>سارافون
<ul>
<li>S</li>
<li>M</li>
<li>L</li>
</ul>
</li>
</ul>
</li>
<li><i class="fa fa-fw fa-dollar"></i> تخفیفات</li>
<li><i class="fa fa-fw fa-phone"></i> Contact</li>
</ul>
</div>
</body>
</html>

Remove end line in CSS Navigation Bar

I am having trouble with my CSS navigation bar. I am unable to remove the end line in the navigation bar. It looks out of place and unprofessional.
When i minus the width, it just moves the end tab below the navigation bar.
Any help or ideas on how to fix this?
Code:
#cssmenu,
#cssmenu ul,
#cssmenu li,
#cssmenu a {
border: none;
line-height: 1;
margin: 0;
padding: 0;
}
#cssmenu {
height: 37px;
display: block;
border: 1px solid;
border-radius: 5px;
width: auto;
border-color: #336699;
margin: 0;
padding: 0;
}
#cssmenu > ul {
list-style: inside none;
margin: 0;
padding: 0;
}
#cssmenu > ul > li {
list-style: inside none;
float: left;
display: inline-block;
position: relative;
margin: 0;
padding: 0;
}
#cssmenu.align-center > ul {
text-align: center;
}
#cssmenu.align-center > ul > li {
float: none;
margin-left: -3px;
}
#cssmenu.align-center ul ul {
text-align: left;
}
#cssmenu.align-center > ul > li:first-child > a {
border-radius: 0;
}
#cssmenu > ul > li > a {
outline: none;
display: block;
position: relative;
text-align: center;
text-decoration: none;
text-shadow: 1px 1px 0 rgba(55, 110, 166, 0.6);
font-weight: 700;
font-size: 13px;
font-family: verdana;
border-right: 1px solid #336699;
color: #ffffff;
padding: 12px 20px;
}
#cssmenu > ul > li:first-child > a {
border-radius: 5px 0 0 5px;
}
#cssmenu > ul > li > a:after {
content: "";
position: absolute;
border-right: 1px solid;
top: -1px;
bottom: -1px;
right: -2px;
z-index: 99;
border-color: #3c3c3c;
}
#cssmenu ul li.has-sub:hover > a:after {
top: 0;
bottom: 0;
}
#cssmenu > ul > li.has-sub > a:before {
content: "";
position: absolute;
top: 18px;
right: 6px;
border: 5px solid transparent;
border-top: 5px solid #ffffff;
}
#cssmenu > ul > li.has-sub:hover > a:before {
top: 19px;
}
#cssmenu > ul > li.has-sub:hover > a {
/*padding-bottom: 14px;*/
z-index: 999;
border-color: #2B5681;
}
#cssmenu ul li.has-sub:hover > ul,
#cssmenu ul li.has-sub:hover > div {
display: block;
}
#cssmenu > ul > li.has-sub > a:hover,
#cssmenu > ul > li.has-sub:hover > a {
background: #2B5681;
border-color: #2B5681;
}
#cssmenu ul li > ul,
#cssmenu ul li > div {
display: none;
width: auto;
position: absolute;
top: 38px;
background: #2B5681;
border-radius: 0 0 5px 5px;
z-index: 999;
padding: 10px 0;
}
#cssmenu ul li > ul {
width: 200px;
}
#cssmenu ul ul ul {
position: absolute;
}
#cssmenu ul ul li:hover > ul {
left: 100%;
top: -10px;
border-radius: 5px;
}
#cssmenu ul li > ul li {
display: block;
list-style: inside none;
position: relative;
margin: 0;
padding: 0;
}
#cssmenu ul li > ul li a {
outline: none;
display: block;
position: relative;
font: 10pt verdana;
color: #ffffff;
text-decoration: none;
text-shadow: 1px 1px 0 rgba(55, 110, 166, 0.6);
margin: 0;
padding: 8px 20px;
}
#cssmenu,
#cssmenu ul ul > li:hover > a,
#cssmenu ul ul li a:hover {
background: #2B5681;
background: -moz-linear-gradient(top, #2B5681 0%, #336699 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #2B5681), color-stop(100%, #336699));
background: -webkit-linear-gradient(top, #2B5681 0%, #336699 100%);
background: -o-linear-gradient(top, #2B5681 0%, #336699 100%);
background: -ms-linear-gradient(top, #2B5681 0%, #336699 100%);
background: linear-gradient(top, #2B5681 0%, #336699 100%);
}
#cssmenu > ul > li > a:hover {
background: #336699;
color: Orange;
}
#cssmenu ul ul a:hover {
color: orange;
font-weight: bold;
}
#cssmenu > ul > li.has-sub > a:hover:before {
border-top: 5px solid Orange;
}
<div id='cssmenu'>
<ul style="display: table;">
<li style="width: 108px;" class='active'><a runat="server" href='~/Applications/Sentinel/Default.aspx'><span>Home</span></a>
</li>
<li style="width: 118px;" class='has-sub'><a><span>Jobs</span></a>
<ul>
<li class='has-sub'><a runat="server" style="text-align: left;" href='~/Applications/Sentinel/Jobs.aspx'>Jobs List<span></span></a>
</li>
<li class='has-sub'><a runat="server" style="text-align: left;" href='~/Applications/Sentinel/AddJob.aspx'><span>Add New Job</span></a>
</li>
</ul>
</li>
</ul>
</div>
Add this line to your css
#cssmenu > ul > li:last-child > a, #cssmenu > ul > li:last-child > a:after {
border-right: none;
}
This code just remove borders from your last menu item.
Add this in your css to remove last border:
#cssmenu > ul > li:last-child a:after, #cssmenu > ul > li:last-child > a {
border-right: 0px solid;
}

Mobile drop down navbar

I cant figure out for the god of me how to get my navbar to show in mobile. I'm not using bootstrap since I already built my own style and when I use bootstrap it conflicts with what I have already made.
I'll paste the css of the menu im using and for mobile portion
#cssmenu,
#cssmenu ul,
#cssmenu ul li,
#cssmenu ul li a,
#cssmenu #menu-button {
margin: 0;
padding: 0;
border: 0;
list-style: none;
line-height: 1;
display: block;
position: relative;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
#cssmenu:after,
#cssmenu > ul:after {
content: ".";
display: block;
clear: both;
visibility: hidden;
line-height: 0;
height: 0;
}
#cssmenu #menu-button {
display: none;
}
#cssmenu {
width: auto;
font-family: 'Open Sans', Helvetica, sans-serif;
background: #39b1cc;
background: -moz-linear-gradient(top, #51bbd2 0%, #2d97af 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #51bbd2), color-stop(100%, #2d97af));
background: -webkit-linear-gradient(top, #51bbd2 0%, #2d97af 100%);
background: -o-linear-gradient(top, #51bbd2 0%, #2d97af 100%);
background: -ms-linear-gradient(top, #51bbd2 0%, #2d97af 100%);
background: linear-gradient(to bottom, #51bbd2 0%, #2d97af 100%);
}
#cssmenu > ul {
background: #000;
box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.05);
}
#cssmenu.align-right > ul > li {
float: right;
}
#cssmenu > ul > li {
float: left;
display: inline-block;
}
#cssmenu.align-center > ul {
float: none;
text-align: center;
}
#cssmenu.align-center > ul > li {
float: none;
}
#cssmenu.align-center ul ul {
text-align: left;
}
#cssmenu > ul > li > a {
padding: 18px 25px 21px 25px;
border-right: 1px solid rgba(80, 80, 80, 0.12);
text-decoration: none;
font-size: 13px;
font-weight: 700;
color: #d3eced;
text-transform: uppercase;
letter-spacing: 1px;
}
#cssmenu > ul > li:hover > a,
#cssmenu > ul > li > a:hover,
#cssmenu > ul > li.active > a {
color: #ffffff;
background: #32a9c3;
background: rgba(0, 0, 0, 0.1);
}
#cssmenu > ul > li.has-sub > a {
padding-right: 45px;
}
#cssmenu > ul > li.has-sub > a::after {
content: "";
position: absolute;
width: 0;
height: 0;
border: 6px solid transparent;
border-top-color: #d3eced;
right: 17px;
top: 22px;
}
#cssmenu > ul > li.has-sub.active > a::after,
#cssmenu > ul > li.has-sub:hover > a {
border-top-color: #ffffff;
}
#cssmenu ul ul {
position: absolute;
left: -9999px;
top: 60px;
padding-top: 6px;
font-size: 13px;
opacity: 0;
-webkit-transition: top 0.2s ease, opacity 0.2s ease-in;
-moz-transition: top 0.2s ease, opacity 0.2s ease-in;
-ms-transition: top 0.2s ease, opacity 0.2s ease-in;
-o-transition: top 0.2s ease, opacity 0.2s ease-in;
transition: top 0.2s ease, opacity 0.2s ease-in;
}
#cssmenu.align-right ul ul {
text-align: right;
}
#cssmenu > ul > li > ul::after {
content: "";
position: absolute;
width: 0;
height: 0;
border: 5px solid transparent;
border-bottom-color: #ffffff;
top: -4px;
left: 20px;
}
#cssmenu.align-right > ul > li > ul::after {
left: auto;
right: 20px;
}
#cssmenu ul ul ul::after {
content: "";
position: absolute;
width: 0;
height: 0;
border: 5px solid transparent;
border-right-color: #ffffff;
top: 11px;
left: -4px;
}
#cssmenu.align-right ul ul ul::after {
border-right-color: transparent;
border-left-color: #ffffff;
left: auto;
right: -4px;
}
#cssmenu > ul > li > ul {
top: 120px;
}
#cssmenu > ul > li:hover > ul {
top: 52px;
left: 0;
opacity: 1;
}
#cssmenu.align-right > ul > li:hover > ul {
left: auto;
right: 0;
}
#cssmenu ul ul ul {
padding-top: 0;
padding-left: 6px;
}
#cssmenu.align-right ul ul ul {
padding-right: 6px;
}
#cssmenu ul ul > li:hover > ul {
left: 180px;
top: 0;
opacity: 1;
}
#cssmenu.align-right ul ul > li:hover > ul {
left: auto;
right: 100%;
opacity: 1;
}
#cssmenu ul ul li a {
text-decoration: none;
font-weight: 400;
padding: 11px 25px;
width: 180px;
color: #777777;
background: #ffffff;
box-shadow: 0 2px 2px rgba(0, 0, 0, 0.1), 1px 1px 1px rgba(0, 0, 0, 0.1), -1px 1px 1px rgba(0, 0, 0, 0.1);
}
#cssmenu ul ul li:hover > a,
#cssmenu ul ul li.active > a {
color: #333333;
}
#cssmenu ul ul li:first-child > a {
border-top-left-radius: 3px;
border-top-right-radius: 3px;
}
#cssmenu ul ul li:last-child > a {
border-bottom-left-radius: 3px;
border-bottom-right-radius: 3px;
}
#cssmenu > ul > li > ul::after {
position: absolute;
display: block;
}
#cssmenu ul ul li.has-sub > a::after {
content: "";
position: absolute;
width: 0;
height: 0;
border: 4px solid transparent;
border-left-color: #777777;
right: 17px;
top: 14px;
}
#cssmenu.align-right ul ul li.has-sub > a::after {
border-left-color: transparent;
border-right-color: #777777;
right: auto;
left: 17px;
}
#cssmenu ul ul li.has-sub.active > a::after,
#cssmenu ul ul li.has-sub:hover > a::after {
border-left-color: #333333;
}
#cssmenu.align-right ul ul li.has-sub.active > a::after,
#cssmenu.align-right ul ul li.has-sub:hover > a::after {
border-right-color: #333333;
border-left-color: transparent;
}
query for mobile
#cssmenu {
background: #39b1cc;
}
#cssmenu > ul {
display: none;
}
#cssmenu > ul.open {
display: block;
border-top: 1px solid rgba(0, 0, 0, 0.1);
}
#cssmenu.align-right > ul {
float: none;
}
#cssmenu.align-center > ul {
text-align: left;
}
#cssmenu > ul > li,
#cssmenu.align-right > ul > li {
float: none;
display: block;
}
#cssmenu > ul > li > a {
padding: 18px 25px 18px 25px;
border-right: 0;
}
#cssmenu > ul > li:hover > a,
#cssmenu > ul > li.active > a {
background: rgba(0, 0, 0, 0.1);
}
#cssmenu #menu-button {
display: block;
text-decoration: none;
font-size: 5px;
font-weight: 700;
color: #d3eced;
padding: 18px 25px 18px 25px;
text-transform: uppercase;
letter-spacing: 1px;
background: url('images/bg.png');
cursor: pointer;
}
#cssmenu ul ul,
#cssmenu ul li:hover > ul,
#cssmenu > ul > li > ul,
#cssmenu ul ul ul,
#cssmenu ul ul li:hover > ul,
#cssmenu.align-right ul ul,
#cssmenu.align-right ul li:hover > ul,
#cssmenu.align-right > ul > li > ul,
#cssmenu.align-right ul ul ul,
#cssmenu.align-right ul ul li:hover > ul {
left: 0;
right: auto;
top: auto;
opacity: 1;
width: 100%;
padding: 0;
position: relative;
text-align: left;
}
#cssmenu ul ul li {
width: 100%;
}
#cssmenu ul ul li a {
width: 100%;
box-shadow: none;
padding-left: 35px;
}
#cssmenu ul ul ul li a {
padding-left: 45px;
}
#cssmenu ul ul li:first-child > a,
#cssmenu ul ul li:last-child > a {
border-radius: 0;
}
#cssmenu #menu-button::after {
display: block;
content: '';
position: absolute;
height: 3px;
width: 22px;
border-top: 2px solid #d3eced;
border-bottom: 2px solid #d3eced;
right: 25px;
top: 18px;
}
#cssmenu #menu-button::before {
display: block;
content: '';
position: absolute;
height: 3px;
width: 22px;
border-top: 2px solid #d3eced;
right: 25px;
top: 28px;
}
#cssmenu > ul > li.has-sub > a::after,
#cssmenu ul ul li.has-sub > a::after {
display: none;
}
}
If you want to do it just with css:
<!DOCTYPE html>
<html>
<head>
<style>
.dropbtn {
background-color: #4CAF50;
color: white;
padding: 16px;
font-size: 16px;
border: none;
cursor: pointer;
}
.dropdown {
position: relative;
display: inline-block;
}
.dropdown-content {
display: none;
position: absolute;
background-color: #f9f9f9;
min-width: 160px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
}
.dropdown-content a {
color: black;
padding: 12px 16px;
text-decoration: none;
display: block;
}
.dropdown-content a:hover {background-color: #f1f1f1}
.dropdown:hover .dropdown-content {
display: block;
}
.dropdown:hover .dropbtn {
background-color: #3e8e41;
}
</style>
</head>
<body>
<div class="dropdown">
<button class="dropbtn">Dropdown</button>
<div class="dropdown-content">
Link 1
Link 2
Link 3
</div>
</div>
</body>
</html>
Here's The Working Fiddle 1
And If you Want it to come down when you click you should use these codes in this fiddle 2

Full-width justified centered navigation

I have responsive navigation, but i wanna have it centered
#import url(http://fonts.googleapis.com/css?family=Open+Sans:400,700);
#cssmenu,
#cssmenu ul,
#cssmenu ul li,
#cssmenu ul li a,
#cssmenu #menu-button {
margin: 0;
padding: 0;
border: 0;
list-style: none;
line-height: 1;
display: block;
position: relative;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
#cssmenu:after,
#cssmenu > ul:after {
content: ".";
display: block;
clear: both;
visibility: hidden;
line-height: 0;
height: 0;
}
#cssmenu #menu-button {
display: none;
}
#cssmenu {
width: auto;
font-family: 'Open Sans', Helvetica, sans-serif;
background: #39b1cc;
background: -moz-linear-gradient(top, #51bbd2 0%, #2d97af 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #51bbd2), color-stop(100%, #2d97af));
background: -webkit-linear-gradient(top, #51bbd2 0%, #2d97af 100%);
background: -o-linear-gradient(top, #51bbd2 0%, #2d97af 100%);
background: -ms-linear-gradient(top, #51bbd2 0%, #2d97af 100%);
background: linear-gradient(to bottom, #51bbd2 0%, #2d97af 100%);
}
#cssmenu > ul {
background: url('images/bg.png');
box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.05);
}
#cssmenu.align-right > ul > li {
float: right;
}
#cssmenu > ul > li {
float: left;
display: inline-block;
}
#cssmenu.align-center > ul {
float: none;
text-align: center;
}
#cssmenu.align-center > ul > li {
float: none;
}
#cssmenu.align-center ul ul {
text-align: left;
}
#cssmenu > ul > li > a {
padding: 18px 25px 21px 25px;
border-right: 1px solid rgba(80, 80, 80, 0.12);
text-decoration: none;
font-size: 13px;
font-weight: 700;
color: #d3eced;
text-transform: uppercase;
letter-spacing: 1px;
}
#cssmenu > ul > li:hover > a,
#cssmenu > ul > li > a:hover,
#cssmenu > ul > li.active > a {
color: #ffffff;
background: #32a9c3;
background: rgba(0, 0, 0, 0.1);
}
#cssmenu > ul > li.has-sub > a {
padding-right: 45px;
}
#cssmenu > ul > li.has-sub > a::after {
content: "";
position: absolute;
width: 0;
height: 0;
border: 6px solid transparent;
border-top-color: #d3eced;
right: 17px;
top: 22px;
}
#cssmenu > ul > li.has-sub.active > a::after,
#cssmenu > ul > li.has-sub:hover > a {
border-top-color: #ffffff;
}
#cssmenu ul ul {
position: absolute;
left: -9999px;
top: 60px;
padding-top: 6px;
font-size: 13px;
opacity: 0;
-webkit-transition: top 0.2s ease, opacity 0.2s ease-in;
-moz-transition: top 0.2s ease, opacity 0.2s ease-in;
-ms-transition: top 0.2s ease, opacity 0.2s ease-in;
-o-transition: top 0.2s ease, opacity 0.2s ease-in;
transition: top 0.2s ease, opacity 0.2s ease-in;
}
#cssmenu.align-right ul ul {
text-align: right;
}
#cssmenu > ul > li > ul::after {
content: "";
position: absolute;
width: 0;
height: 0;
border: 5px solid transparent;
border-bottom-color: #ffffff;
top: -4px;
left: 20px;
}
#cssmenu.align-right > ul > li > ul::after {
left: auto;
right: 20px;
}
#cssmenu ul ul ul::after {
content: "";
position: absolute;
width: 0;
height: 0;
border: 5px solid transparent;
border-right-color: #ffffff;
top: 11px;
left: -4px;
}
#cssmenu.align-right ul ul ul::after {
border-right-color: transparent;
border-left-color: #ffffff;
left: auto;
right: -4px;
}
#cssmenu > ul > li > ul {
top: 120px;
}
#cssmenu > ul > li:hover > ul {
top: 52px;
left: 0;
opacity: 1;
}
#cssmenu.align-right > ul > li:hover > ul {
left: auto;
right: 0;
}
#cssmenu ul ul ul {
padding-top: 0;
padding-left: 6px;
}
#cssmenu.align-right ul ul ul {
padding-right: 6px;
}
#cssmenu ul ul > li:hover > ul {
left: 180px;
top: 0;
opacity: 1;
}
#cssmenu.align-right ul ul > li:hover > ul {
left: auto;
right: 100%;
opacity: 1;
}
#cssmenu ul ul li a {
text-decoration: none;
font-weight: 400;
padding: 11px 25px;
width: 180px;
color: #777777;
background: #ffffff;
box-shadow: 0 2px 2px rgba(0, 0, 0, 0.1), 1px 1px 1px rgba(0, 0, 0, 0.1), -1px 1px 1px rgba(0, 0, 0, 0.1);
}
#cssmenu ul ul li:hover > a,
#cssmenu ul ul li.active > a {
color: #333333;
}
#cssmenu ul ul li:first-child > a {
border-top-left-radius: 3px;
border-top-right-radius: 3px;
}
#cssmenu ul ul li:last-child > a {
border-bottom-left-radius: 3px;
border-bottom-right-radius: 3px;
}
#cssmenu > ul > li > ul::after {
position: absolute;
display: block;
}
#cssmenu ul ul li.has-sub > a::after {
content: "";
position: absolute;
width: 0;
height: 0;
border: 4px solid transparent;
border-left-color: #777777;
right: 17px;
top: 14px;
}
#cssmenu.align-right ul ul li.has-sub > a::after {
border-left-color: transparent;
border-right-color: #777777;
right: auto;
left: 17px;
}
#cssmenu ul ul li.has-sub.active > a::after,
#cssmenu ul ul li.has-sub:hover > a::after {
border-left-color: #333333;
}
#cssmenu.align-right ul ul li.has-sub.active > a::after,
#cssmenu.align-right ul ul li.has-sub:hover > a::after {
border-right-color: #333333;
border-left-color: transparent;
}
#media all and (max-width: 800px),
only screen and (-webkit-min-device-pixel-ratio: 2) and (max-width: 1024px),
only screen and (min--moz-device-pixel-ratio: 2) and (max-width: 1024px),
only screen and (-o-min-device-pixel-ratio: 2/1) and (max-width: 1024px),
only screen and (min-device-pixel-ratio: 2) and (max-width: 1024px),
only screen and (min-resolution: 192dpi) and (max-width: 1024px),
only screen and (min-resolution: 2dppx) and (max-width: 1024px) {
#cssmenu {
background: #39b1cc;
}
#cssmenu > ul {
display: none;
}
#cssmenu > ul.open {
display: block;
border-top: 1px solid rgba(0, 0, 0, 0.1);
}
#cssmenu.align-right > ul {
float: none;
}
#cssmenu.align-center > ul {
text-align: left;
}
#cssmenu > ul > li,
#cssmenu.align-right > ul > li {
float: none;
display: block;
}
#cssmenu > ul > li > a {
padding: 18px 25px 18px 25px;
border-right: 0;
}
#cssmenu > ul > li:hover > a,
#cssmenu > ul > li.active > a {
background: rgba(0, 0, 0, 0.1);
}
#cssmenu #menu-button {
display: block;
text-decoration: none;
font-size: 13px;
font-weight: 700;
color: #d3eced;
padding: 18px 25px 18px 25px;
text-transform: uppercase;
letter-spacing: 1px;
background: url('images/bg.png');
cursor: pointer;
}
#cssmenu ul ul,
#cssmenu ul li:hover > ul,
#cssmenu > ul > li > ul,
#cssmenu ul ul ul,
#cssmenu ul ul li:hover > ul,
#cssmenu.align-right ul ul,
#cssmenu.align-right ul li:hover > ul,
#cssmenu.align-right > ul > li > ul,
#cssmenu.align-right ul ul ul,
#cssmenu.align-right ul ul li:hover > ul {
left: 0;
right: auto;
top: auto;
opacity: 1;
width: 100%;
padding: 0;
position: relative;
text-align: left;
}
#cssmenu ul ul li {
width: 100%;
}
#cssmenu ul ul li a {
width: 100%;
box-shadow: none;
padding-left: 35px;
}
#cssmenu ul ul ul li a {
padding-left: 45px;
}
#cssmenu ul ul li:first-child > a,
#cssmenu ul ul li:last-child > a {
border-radius: 0;
}
#cssmenu #menu-button::after {
display: block;
content: '';
position: absolute;
height: 3px;
width: 22px;
border-top: 2px solid #d3eced;
border-bottom: 2px solid #d3eced;
right: 25px;
top: 18px;
}
#cssmenu #menu-button::before {
display: block;
content: '';
position: absolute;
height: 3px;
width: 22px;
border-top: 2px solid #d3eced;
right: 25px;
top: 28px;
}
#cssmenu > ul > li.has-sub > a::after,
#cssmenu ul ul li.has-sub > a::after {
display: none;
}
}
<div id='cssmenu'>
<ul>
<li><a href='#'><span>Home</span></a>
</li>
<li class='active has-sub'><a href='#'><span>Products</span></a>
<li>AKCIJA
</li>
<li>RABLJENO
</li>
<li>ZRAČNI HOKEJ
</li>
<li>KOŠARKA
</li>
<li>BOXER
</li>
<li>HAMMER Us
</li>
<li>KICKER
</li>
<li>STOLNI NOGOMET
</li>
<li>KICKBOXER
</li>
<li>MONEY CHANGER
</li>
<li>CRANES
</li>
<li>PIKADO
</li>
<li>KIDDIE RIDES
</li>
<li>VRTULJAK
</li>
<li>BAGER
</li>
<li>FOTO KABINE
</li>
<li>FLIPER
</li>
<li>STOLNI TENIS
</li>
<li>BILJARI
</li>
<li>PRIZE MACHINE
</li>
<li>APARATI S NAGRADNIM KUPONIMA
</li>
<li>VENDING MASHINE
</li>
<li>VIDEO IGRE
</li>
<li>SIMULATORI
</li>
<li>CATCH THE LIGHT
</li>
<li>SIMULATOR F1
</li>
<li>VAGA
</li>
<li>TRAINS
</li>
<li>THEATRE
</li>
</ul>
</div>
here is my code https://jsfiddle.net/2wuzujvL/
i wanna have it something like http://www.456bereastreet.com/lab/full-width-justified-vertically-centered-navbar/
I don't know what else to try so if you could help me.