The url is not working - html

The link of this url is not working , I am using bootstrap for dropdown.
<a data-target="#" href="washington-record-sealing/" role="button" class="dropdown-toggle" data-toggle="dropdown">
Record Sealing <i class="fa fa-angle-down"></i>
</a>

I think you looking for these.
a {
text-decoration: none;
}
a:hover {
color: #ec4445;
text-decoration: none;
}
a:active, a:hover {
outline: 0 none;
}
ul {
list-style: outside none none;
margin: 0;
padding: 0
}
.main-menu ul li {
float: left;
position: relative;
}
.main-menu ul li a {
color: #444;
display: block;
font-size: 14px;
font-weight: 600;
padding: 15px 20px;
text-transform: uppercase;
}
.main-menu > ul > li:hover > a {
color: #83cbdc;
}
.main-menu ul li::before {
background: #ddd none repeat scroll 0 0;
content: "";
height: 40px;
left: 0;
position: absolute;
top: 10px;
width: 1px;
}
.main-menu ul li ul {
background: #393939 none repeat scroll 0 0;
left: 0;
position: absolute;
width: 200px;
transition: 0.3s;
opacity: 0;
top: 160%;
visibility: hidden;
}
.main-menu ul li:hover ul {
opacity: 1;
visibility: visible;
top: 100%;
}
.main-menu ul li ul li:before {
display: none;
}
.main-menu ul li ul li {
float: none;
}
.main-menu ul li ul li a {
color: #9e9e9e;
font-weight: 400;
padding: 7px 20px;
text-transform: capitalize;
transition: 0.3s;
}
.main-menu ul li ul li:hover a {
color: #5eb4dc;
font-weight: 500;
padding-left: 30px;
}
.main-menu ul li .mega-menu {
background: #393939;
left: 0;
width: 700px;
position: absolute;
top: 160%;
transition: 0.3s;
opacity: 0;
visibility: hidden;
text-align: left;
}
.main-menu ul li:hover .mega-menu {
opacity: 1;
visibility: visible;
top: 100%;
}
.main-menu ul li .mega-menu span {
width: 33.33%;
float: left;
}
.main-menu ul li .mega-menu span a {
color: #9e9e9e;
font-weight: normal;
font-size: 13px;
margin: 0 25px;
padding: 8px 0;
text-transform: capitalize;
transition: 0.4s;
}
.main-menu ul li .mega-menu span a:hover {
color: #6cc6d6;
font-weight: 500;
padding-left: 15px;
}
.main-menu ul li .mega-menu span a.mega-title {
border-bottom: 1px solid #9e9e9e;
font-weight: 600;
margin-bottom: 10px;
margin-top: 15px;
text-transform: uppercase;
}
.main-menu ul li .mega-menu span a.mega-title:hover {
padding-left: 0;
}
<div class="main-menu-area">
<div class="container">
<div class="row">
<div class="col-md-11">
<div class="main-menu">
<nav>
<ul>
<li>home <i class="fa fa-caret-down"></i>
<ul>
<li>home version 1</li>
<li>home version 1</li>
<li>home version 1</li>
<li>home version 1</li>
<li>home version 1</li>
<li>home version 1</li>
</ul>
</li>
<li>mega menu <i class="fa fa-caret-down"></i>
<div class="mega-menu">
<span>
<a class="mega-title" href="#">Mega title</a>
Mega item 1
Mega item 2
Mega item 3
Mega item 4
Mega item 5
</span>
<span>
<a class="mega-title" href="#">Mega title</a>
Mega item 1
Mega item 2
Mega item 3
Mega item 4
Mega item 5
</span>
<span>
<a class="mega-title" href="#">Mega title</a>
Mega item 1
Mega item 2
Mega item 3
Mega item 4
Mega item 5
</span>
</div>
</li>
<li>work <i class="fa fa-caret-down"></i></li>
<li>shop <i class="fa fa-caret-down"></i></li>
<li>blog <i class="fa fa-caret-down"></i>
<ul>
<li>blog page 1</li>
<li>blog page 1</li>
<li>blog page 1</li>
<li>blog page 1</li>
<li>blog page 1</li>
</ul>
</li>
<li>contact <i class="fa fa-caret-down"></i></li>
</ul>
</nav>
</div>
</div>
</div>
</div>
</div>

Related

Create a sub menu html

Hey i have quite a bit of a design to my dropdown menu and im having trouble adding a submenu to lets say to the first element on the dropdown-cotent div.
I simply want the sub menu to start where the hover of the submeneu is defined and to the right and drop down the same way as my current sub menu does it.
Here is my html:
<nav>
<div class="main-nav">
<ul class="left">
<li class="dropdown">Home
<div class="dropdown-content">
Third
Third Link
Third Link 3
</div>
</li>
<li>Gods</li>
<li>Goddesses</li>
</ul>
<div class="play-now"></div>
<ul class="right">
<li>Heroes</li>
<li>Myths</li>
<li>Beasts</li>
</ul>
</div>
</nav>
And here is the css to it all:
nav {
padding-left: 5px
}
nav .main-nav {
height: 80px;
width: 100%;
margin-top: 64px;
background: url(../images/navHeader.png) no-repeat top;
position: relative
}
nav .main-nav ul {
width: 360px;
height: 80px;
margin-top: 2px;
padding: 0;
list-style-type: none
}
nav .main-nav ul a,
nav .main-nav ul li {
display: inline-block;
width: 105px;
line-height: 80px;
height: 80px
}
nav .main-nav .dropdown-content a {
height: auto;
line-height: initial;
padding: 3px 0;
}
nav .main-nav ul a {
text-align: center;
font-weight: 550;
font-size: 12px;
color: #84827d;
text-shadow: 1px 1px 1px 1px #000;
text-transform: uppercase;
-webkit-transition: all .2s ease-in-out;
transition: all .2s ease-in-out
}
nav .main-nav ul a:hover {
text-decoration: none;
color: #7289da
}
nav .main-nav li .dropdown {
}
nav .main-nav .dropdown-content {
position: absolute;
display: none;
float: left;
z-index: 10;
-webkit-box-shadow: 0 3px 5px 0 #999;
-moz-box-shadow: 0 3px 5px 0 #999;
box-shadow: 0 3px 5px 0 #999;
border: 1px solid #CCC;
background: #3A4FC5;
color: #656161;
opacity: .8;
min-width: 30px;
top: 60px;
}
nav .main-nav .dropdown-content a {
color: black;
text-decoration: none;
display: block;
text-align: center;
}
nav .main-nav .dropdown-content a:hover {
background-color: #3A4FC5
}
nav .main-nav .dropdown:hover .dropdown-content {
display: inline-block;
}
nav .main-nav ul.left {
float: left;
margin-left: 5px;
}
nav .main-nav ul.right {
float: right;
margin-left: 5px
}
Here is snippet,
nav {
padding-left: 5px
}
nav .main-nav {
height: 80px;
width: 100%;
margin-top: 64px;
background: url(../images/navHeader.png) no-repeat top;
position: relative
}
nav .main-nav ul {
width: 360px;
height: 80px;
margin-top: 2px;
padding: 0;
list-style-type: none
}
nav .main-nav ul a,
nav .main-nav ul li {
display: inline-block;
width: 105px;
line-height: 80px;
height: 80px
}
nav .main-nav .dropdown-content a {
height: auto;
line-height: initial;
padding: 3px 0;
}
nav .main-nav ul a {
text-align: center;
font-weight: 550;
font-size: 12px;
color: #84827d;
text-shadow: 1px 1px 1px 1px #000;
text-transform: uppercase;
-webkit-transition: all .2s ease-in-out;
transition: all .2s ease-in-out
}
nav .main-nav ul a:hover {
text-decoration: none;
color: #7289da
}
nav .main-nav li .dropdown {
}
nav .main-nav .dropdown-content {
position: absolute;
display: none;
float: left;
z-index: 10;
-webkit-box-shadow: 0 3px 5px 0 #999;
-moz-box-shadow: 0 3px 5px 0 #999;
box-shadow: 0 3px 5px 0 #999;
border: 1px solid #CCC;
background: #3A4FC5;
color: #656161;
opacity: .8;
min-width: 30px;
top: 60px;
}
nav .main-nav .dropdown-content a {
color: black;
text-decoration: none;
display: block;
text-align: center;
}
nav .main-nav .dropdown-content a:hover {
background-color: #3A4FC5
}
nav .main-nav .dropdown:hover .dropdown-content {
display: inline-block;
}
nav .main-nav ul.left {
float: left;
margin-left: 5px;
}
nav .main-nav ul.right {
float: right;
margin-left: 5px
}
<nav>
<div class="main-nav">
<ul class="left">
<li class="dropdown">Home
<div class="dropdown-content">
Third
Third Link
Third Link 3
</div>
</li>
<li>Gods</li>
<li>Goddesses</li>
</ul>
<div class="play-now"></div>
<ul class="right">
<li>Heroes</li>
<li>Myths</li>
<li>Beasts</li>
</ul>
</div>
</nav>
$(document).ready(function(){
$('.dropdown-submenu a.test').on("click", function(e){
$(this).next('ul').toggle();
e.stopPropagation();
e.preventDefault();
});
});
<style>
.dropdown-submenu {
position: relative;
}
.dropdown-submenu .dropdown-menu {
top: 0;
left: 100%;
margin-top: -1px;
}
</style>
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container">
<div class="dropdown">
<button class="btn btn-default dropdown-toggle" type="button" data-toggle="dropdown">Dropdown
<span class="caret"></span></button>
<ul class="dropdown-menu">
<li><a tabindex="-1" href="#">HTML</a></li>
<li><a tabindex="-1" href="#">CSS</a></li>
<li class="dropdown-submenu">
<a class="test" tabindex="-1" href="#">New dropdown <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a tabindex="-1" href="#">2nd level dropdown</a></li>
<li><a tabindex="-1" href="#">2nd level dropdown</a></li>
<li class="dropdown-submenu">
<a class="test" href="#">Another dropdown <span class="caret"></span></a>
<ul class="dropdown-menu">
<li>3rd level dropdown</li>
<li>3rd level dropdown</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
</body>
</html>
Did you mean to say this?
nav {
padding-left: 5px
}
nav .main-nav {
height: 80px;
width: 100%;
margin-top: 64px;
background: url(../images/navHeader.png) no-repeat top;
position: relative
}
nav .main-nav > ul {
width: 360px;
height: 80px;
margin-top: 2px;
padding: 0;
list-style-type: none
}
nav .main-nav ul a,
nav .main-nav ul li {
display: inline-block;
width: 105px;
line-height: 80px;
height: 80px
}
nav .main-nav .dropdown-content a {
height: auto;
line-height: initial;
padding: 3px 0;
}
nav .main-nav ul a {
text-align: center;
font-weight: 550;
font-size: 12px;
color: #84827d;
text-shadow: 1px 1px 1px 1px #000;
text-transform: uppercase;
-webkit-transition: all .2s ease-in-out;
transition: all .2s ease-in-out
}
nav .main-nav ul a:hover {
text-decoration: none;
color: #7289da
}
nav .main-nav li .dropdown {
}
nav .main-nav .dropdown-content {
position: absolute;
display: none;
float: left;
z-index: 10;
-webkit-box-shadow: 0 3px 5px 0 #999;
-moz-box-shadow: 0 3px 5px 0 #999;
box-shadow: 0 3px 5px 0 #999;
border: 1px solid #CCC;
background: #3A4FC5;
color: #656161;
opacity: .8;
min-width: 30px;
top: 60px;
}
nav .main-nav .dropdown-content a {
color: black;
text-decoration: none;
display: block;
text-align: center;
}
nav .main-nav .dropdown-content a:hover {
background-color: #3A4FC5
}
nav .main-nav .dropdown:hover .dropdown-content {
display: inline-block;
}
nav .main-nav ul.left {
float: left;
margin-left: 5px;
}
.dropdown-content ul {
padding: 0;
width: auto !important;
display: flex;
flex-direction: column;
}
.dropdown-content ul li {
height: auto !important;
position: relative;
}
.dropdown-content ul li:hover > .dropdown-content-second {
display: block;
}
.dropdown-content-second {
position: absolute;
display: none;
float: left;
z-index: 10;
-webkit-box-shadow: 0 3px 5px 0 #999;
-moz-box-shadow: 0 3px 5px 0 #999;
box-shadow: 0 3px 5px 0 #999;
border: 1px solid #CCC;
background: #3A4FC5;
color: #656161;
opacity: .8;
min-width: 30px;
top: 0;
left: 100%;
}
.dropdown-content-second ul li {
position: relative;
}
nav .main-nav ul.right {
float: right;
margin-left: 5px
}
<nav>
<div class="main-nav">
<ul class="left">
<li class="dropdown">Home
<div class="dropdown-content">
<ul>
<li>
Third
<div class="dropdown-content-second">
<ul>
<li>
Navi 1
</li>
<li>
Navi 2
</li>
<li>
Navi 3
<div class="dropdown-content-second">
<ul>
<li>
Navi 1
</li>
<li>
Navi 2
</li>
<li>
Navi 3
</li>
<li>
Navi 4
</li>
<li>
Navi 5
</li>
</ul>
</div>
</li>
</ul>
</div>
</li>
<li>
Third Link
</li>
<li>
Third Link 3
</li>
</ul>
</div>
</li>
<li>Gods</li>
<li>Goddesses</li>
</ul>
<div class="play-now"></div>
<ul class="right">
<li>Heroes</li>
<li>Myths</li>
<li>Beasts</li>
</ul>
</div>
</nav>
Take a look on my menu
#import url(https://fonts.googleapis.com/css?family=Oxygen+Mono);
/* Starter CSS for Menu */
#cssmenu {
padding: 0;
margin: 0;
border: 0;
width: auto;
}
#cssmenu ul,
#cssmenu li {
list-style: none;
margin: 0;
padding: 0;
}
#cssmenu ul {
position: relative;
z-index: 597;
}
#cssmenu ul li {
float: left;
min-height: 1px;
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: 0;
left: 190px;
width: 190px;
}
#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;
}
#cssmenu a {
display: block;
line-height: 1em;
text-decoration: none;
}
/* Custom CSS Styles */
#cssmenu {
background: #333;
border-bottom: 4px solid #9c9797;
font-family: 'Oxygen Mono', Tahoma, Arial, sans-serif;
font-size: 12px;
}
#cssmenu > ul {
*display: inline-block;
}
#cssmenu:after,
#cssmenu ul:after {
content: '';
display: block;
clear: both;
}
#cssmenu ul {
text-transform: uppercase;
}
#cssmenu ul ul {
border-top: 4px solid #9c9797;
text-transform: none;
min-width: 190px;
}
#cssmenu ul ul a {
background: #9c9797;
color: #ffffff;
border: 1px solid #837d7d;
border-top: 0 none;
line-height: 150%;
padding: 16px 20px;
font-size: 12px;
}
#cssmenu ul ul ul {
border-top: 0 none;
}
#cssmenu ul ul li {
position: relative;
}
#cssmenu ul ul li:first-child > a {
border-top: 1px solid #837d7d;
}
#cssmenu ul ul li:hover > a {
background: #b5b1b1;
color: #ffffff;
}
#cssmenu ul 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;
-moz-background-clip: padding;
-webkit-background-clip: padding-box;
background-clip: padding-box;
-moz-box-shadow: 0 1px 0 #9c9797;
-webkit-box-shadow: 0 1px 0 #9c9797;
box-shadow: 0 1px 0 #9c9797;
}
#cssmenu ul ul li:last-child:hover > a {
-moz-border-radius: 0 0 0 3px;
-webkit-border-radius: 0 0 0 3px;
border-radius: 0 0 0 3px;
-moz-background-clip: padding;
-webkit-background-clip: padding-box;
background-clip: padding-box;
}
#cssmenu ul ul li.has-sub > a:after {
content: '+';
position: absolute;
top: 50%;
right: 15px;
margin-top: -8px;
}
#cssmenu ul li:hover > a,
#cssmenu ul li.active > a {
background: #9c9797;
color: #ffffff;
}
#cssmenu ul li.has-sub > a:after {
content: '+';
margin-left: 5px;
}
#cssmenu ul li.last ul {
left: auto;
right: 0;
}
#cssmenu ul li.last ul ul {
left: auto;
right: 99.5%;
}
#cssmenu a {
background: #333;
color: #CBCBCB;
padding: 0 20px;
}
#cssmenu > ul > li > a {
line-height: 48px;
font-size: 12px;
}
#cssmenu.align-center > ul {
text-align: center;
font-size: 0;
}
#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.align-right ul ul {
left: auto;
right: 0;
text-align: right;
}
#cssmenu.align-right ul ul ul {
left: auto;
right: 190px;
}
#cssmenu.align-right ul ul li.has-sub > a:after {
left: 15px;
right: auto;
}
<html lang="ru" dir="ltr">
<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">
</head>
<body>
<div id="cssmenu">
<ul>
<li class="active"><i class="fa fa-fw fa-home"></i> Home</li>
<li class="has-sub"><i class="fa fa-fw fa-bars"></i> Menus
<ul>
<li class="has-sub">Menu 1
<ul>
<li>Menu 1.1</li>
<li>Menu 1.2</li>
<li>Menu 1.3</li>
<li class="has-sub">Menu 1.4
<ul>
<li>Menu 1.4.1</li>
<li>Menu 1.4.2</li>
<li>Menu 1.4.3</li>
<li>Menu 1.4.4</li>
</ul>
</li>
</ul>
</li>
<li class="has-sub">Menu 2
<ul>
<li>Menu 2.1</li>
<li>Menu 2.2</li>
<li>Menu 2.3</li>
</ul>
</li>
<li class="has-sub">Menu 3
<ul>
<li>Menu 3.1</li>
<li>Menu 3.2</li>
<li class="has-sub">Menu 3.3
<ul>
<li>Menu 3.3.1</li>
<li>Menu 3.3.2</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
<li><i class="fa fa-fw fa-cog"></i> About us</li>
<li><i class="fa fa-fw fa-phone"></i> Contact</li>
</ul>
</div>
</body>
</html>

html css ul and button issue

Hi so in this my explore more button and my ul list so whenever I move my explore button line height the ul and button both move together side..and I want the explore more button downward. what should I do?? I tried using other attributes but nothing worked. I am making this website for my dad's academy.
Here is my HTML code
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<header>
<div class="row">
<div>
<ul class="main-nav">
<li>Home</li>
<li>About</li>
<li>Study Visa
<ul>
<li>Australia</li>
<li>Canada</li>
<li>New Zealand</li>
</ul>
</li>
<li>Courses
<ul>
<li>Ielts</li>
<li>PTE</li>
<li>Spoken English</li>
</ul>
</li>
<li>Contact Us
</li>
<li> Login </li>
<li>Reviews</li>
</ul>
</div>
<div class="button">
Explore More
</div>
</div>
</header>
</header>
</body>
this is my CSS code
body {
background: url(abc.jpg) no-repeat;
background-size: none;
background-position : none;
background-size : cover;
margin-left: 20%;
}
.main-nav
{
margin: 0px;
padding: 0px;
list-style: none;
font-family: arial;
position: absolute
top : 20px;
}
.main-nav li {
float: left;
width: 145px;
height: 67px;
background-color: black;
opacity: 0.8;
line-height: 67px;
text-align: center;
font-size: 22px;
margin-left : px;
}
.main-nav li a {
text-decoration: none;
color: white;
display: block;
line-height : 100 px ;
}
.main-nav li a:hover {
background-color: orange;
}
.main-nav li ul li{
display: none;
}
.main-nav li:hover ul li {
display: block;
}.button
{
margin-top: 350px;
margin-left: 320px;
}
.btn
{
border: 1px solid white;
padding: 10px 30px;
color: white;
text-decoration: none;
margin-right: 89px;
font-size: 13px;
text-transform: uppercase;
}
.btn-two
{
font-family: "Roboto", sans-serif;
}
.btn-two:hover
{
background-color: darkorange;
transition: all 0.5s ease-in;
}
so I want the menu above near k academy logo.. and explore more button where it is. thanks!!
I changed up your HTML structure since there were empty tags and random closing tags. CSS i basically just removed the float on the li, since that takes it out of the flow, and instead added flexbox to the ul. Hope that helps flexbox ftw. Idk how your button ended up in that location but I would use position: absolute on that top,right,bottom,left:0 margin: auto;
body {
background: url(abc.jpg) no-repeat;
background-size: none;
background-position: none;
background-size: cover;
}
.main-nav {
display: flex;
justify-content: space-between;
alig margin: 0px;
padding: 0px;
list-style: none;
font-family: arial;
}
.main-nav li {
width: 145px;
height: 67px;
background-color: black;
opacity: 0.8;
line-height: 67px;
text-align: center;
font-size: 22px;
margin-left: px;
}
.main-nav li a {
text-decoration: none;
color: white;
display: block;
line-height: 100 px;
}
.main-nav li a:hover {
background-color: orange;
}
.main-nav li ul li {
display: none;
}
.main-nav li:hover ul li {
display: block;
}
.button {
margin-top: 350px;
margin-left: 320px;
}
.btn {
border: 1px solid white;
padding: 10px 30px;
color: white;
text-decoration: none;
margin-right: 89px;
font-size: 13px;
text-transform: uppercase;
}
.btn-two {
font-family: "Roboto", sans-serif;
}
.btn-two:hover {
background-color: darkorange;
transition: all 0.5s ease-in;
}
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<header>
<ul class="main-nav">
<li>Home</li>
<li>About</li>
<li>Study Visa
<ul>
<li>Australia</li>
<li>Canada</li>
<li>New Zealand</li>
</ul>
</li>
<li>Courses
<ul>
<li>Ielts</li>
<li>PTE</li>
<li>Spoken English</li>
</ul>
</li>
<li>Contact Us
</li>
<li> Login </li>
<li>Reviews</li>
</ul>
<div class="button">
Explore More
</div>
</header>
</body>
I hope this will help you to solve the problem.
.main-menu {
background-color: #444;
}
.main-menu nav ul {
margin: 0;
padding: 0;
}
.main-menu nav > ul > li {
display: inline-block;
position: relative;
margin: 0;
}
.main-menu nav > ul > li a {
display: block;
color: #fff;
font-size: 16px;
padding: 20px 15px;
text-decoration: none;
transition: .3s;
}
.main-menu nav > ul > li:hover > a {
color: #7AA93C;
}
.main-menu nav ul li ul {
position: absolute;
padding: 10px 0;
width: 200px;
box-shadow: 0 0 10px rgba(0,0,0,0.5);
top: 150%;
opacity: 0;
visibility: hidden;
transition: .3s;
}
.main-menu nav ul li:hover ul {
top: 100%;
opacity: 1;
visibility: visible;
}
.main-menu nav ul li ul li {
display: block;
padding: 0;
margin: 0;
}
.main-menu nav ul li ul li a {
display: block;
text-decoration: none;
padding: 6px 20px;
font-size: 14px;
color: #444;
transition: .3s;
}
.main-menu nav ul li ul li:hover a {
color: #7AA93C;
}
<div class="main-menu">
<nav>
<ul>
<li>
Home
<!-- submenu start -->
<ul class="submenu">
<li>Sub Menu</li>
<li>Sub Menu</li>
<li>Sub Menu</li>
<li>Sub Menu</li>
<li>Sub Menu</li>
</ul>
<!-- submenu end -->
</li>
<li>About</li>
<li>
Service
<!-- submenu start -->
<ul class="submenu">
<li>Sub Menu</li>
<li>Sub Menu</li>
<li>Sub Menu</li>
<li>Sub Menu</li>
<li>Sub Menu</li>
</ul>
<!-- submenu end -->
</li>
<li>Contact</li>
</ul>
</nav>
</div>

Side menu not working

I am trying to insert this side menu in my website but even if I write it in a blank document doesn't visualize properly to me.
All the drop down links don't work and are shown me as open.
Therefore on mobile the menu keeps still open with no chance to be collapsed in the burger.
Please help and thanks!
.nav-side-menu {
overflow: auto;
font-family: verdana;
font-size: 12px;
font-weight: 200;
background-color: #2e353d;
position: fixed;
top: 0px;
width: 300px;
height: 100%;
color: #e1ffff;
}
.nav-side-menu .brand {
background-color: #23282e;
line-height: 50px;
display: block;
text-align: center;
font-size: 14px;
}
.nav-side-menu .toggle-btn {
display: none;
}
.nav-side-menu ul,
.nav-side-menu li {
list-style: none;
padding: 0px;
margin: 0px;
line-height: 35px;
cursor: pointer;
/*
.collapsed{
.arrow:before{
font-family: FontAwesome;
content: "\f053";
display: inline-block;
padding-left:10px;
padding-right: 10px;
vertical-align: middle;
float:right;
}
}
*/
}
.nav-side-menu ul :not(collapsed) .arrow:before,
.nav-side-menu li :not(collapsed) .arrow:before {
font-family: FontAwesome;
content: "\f078";
display: inline-block;
padding-left: 10px;
padding-right: 10px;
vertical-align: middle;
float: right;
}
.nav-side-menu ul .active,
.nav-side-menu li .active {
border-left: 3px solid #d19b3d;
background-color: #4f5b69;
}
.nav-side-menu ul .sub-menu li.active,
.nav-side-menu li .sub-menu li.active {
color: #d19b3d;
}
.nav-side-menu ul .sub-menu li.active a,
.nav-side-menu li .sub-menu li.active a {
color: #d19b3d;
}
.nav-side-menu ul .sub-menu li,
.nav-side-menu li .sub-menu li {
background-color: #181c20;
border: none;
line-height: 28px;
border-bottom: 1px solid #23282e;
margin-left: 0px;
}
.nav-side-menu ul .sub-menu li:hover,
.nav-side-menu li .sub-menu li:hover {
background-color: #020203;
}
.nav-side-menu ul .sub-menu li:before,
.nav-side-menu li .sub-menu li:before {
font-family: FontAwesome;
content: "\f105";
display: inline-block;
padding-left: 10px;
padding-right: 10px;
vertical-align: middle;
}
.nav-side-menu li {
padding-left: 0px;
border-left: 3px solid #2e353d;
border-bottom: 1px solid #23282e;
}
.nav-side-menu li a {
text-decoration: none;
color: #e1ffff;
}
.nav-side-menu li a i {
padding-left: 10px;
width: 20px;
padding-right: 20px;
}
.nav-side-menu li:hover {
border-left: 3px solid #d19b3d;
background-color: #4f5b69;
-webkit-transition: all 1s ease;
-moz-transition: all 1s ease;
-o-transition: all 1s ease;
-ms-transition: all 1s ease;
transition: all 1s ease;
}
#media (max-width: 767px) {
.nav-side-menu {
position: relative;
width: 100%;
margin-bottom: 10px;
}
.nav-side-menu .toggle-btn {
display: block;
cursor: pointer;
position: absolute;
right: 10px;
top: 10px;
z-index: 10 !important;
padding: 3px;
background-color: #ffffff;
color: #000;
width: 40px;
text-align: center;
}
.brand {
text-align: left !important;
font-size: 22px;
padding-left: 20px;
line-height: 50px !important;
}
}
#media (min-width: 767px) {
.nav-side-menu .menu-list .menu-content {
display: block;
}
}
body {
margin: 0px;
padding: 0px;
}
<head>
<link rel="stylesheet" href="prova.css">
<link href="http://maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css" rel="stylesheet">
</head>
<body>
<div class="nav-side-menu">
<div class="brand">Brand Logo</div>
<i class="fa fa-bars fa-2x toggle-btn" data-toggle="collapse" data-target="#menu-content"></i>
<div class="menu-list">
<ul id="menu-content" class="menu-content collapse out">
<li>
<a href="#">
<i class="fa fa-dashboard fa-lg"></i> Dashboard
</a>
</li>
<li data-toggle="collapse" data-target="#products" class="collapsed active">
<i class="fa fa-gift fa-lg"></i> UI Elements <span class="arrow"></span>
</li>
<ul class="sub-menu collapse" id="products">
<li class="active">CSS3 Animation</li>
<li>General</li>
<li>Buttons</li>
<li>Tabs & Accordions</li>
<li>Typography</li>
<li>FontAwesome</li>
<li>Slider</li>
<li>Panels</li>
<li>Widgets</li>
<li>Bootstrap Model</li>
</ul>
<li data-toggle="collapse" data-target="#service" class="collapsed">
<i class="fa fa-globe fa-lg"></i> Services <span class="arrow"></span>
</li>
<ul class="sub-menu collapse" id="service">
<li>New Service 1</li>
<li>New Service 2</li>
<li>New Service 3</li>
</ul>
<li data-toggle="collapse" data-target="#new" class="collapsed">
<i class="fa fa-car fa-lg"></i> New <span class="arrow"></span>
</li>
<ul class="sub-menu collapse" id="new">
<li>New New 1</li>
<li>New New 2</li>
<li>New New 3</li>
</ul>
<li>
<a href="#">
<i class="fa fa-user fa-lg"></i> Profile
</a>
</li>
<li>
<a href="#">
<i class="fa fa-users fa-lg"></i> Users
</a>
</li>
</ul>
</div>
</div>
</body>
</html>
If you wanna do it with pure CSS and no JavaScript, I think you wanna do sth like this, that the menu only shows when you :hover over it, hope this is helpful.
Simple Pure CSS Drop Down Menu
#primary_nav_wrap
{
margin-top:15px
}
#primary_nav_wrap ul
{
list-style:none;
position:relative;
float:left;
margin:0;
padding:0
}
#primary_nav_wrap ul a
{
display:block;
color:#333;
text-decoration:none;
font-weight:700;
font-size:12px;
line-height:32px;
padding:0 15px;
font-family:"HelveticaNeue","Helvetica Neue",Helvetica,Arial,sans-serif
}
#primary_nav_wrap ul li
{
position:relative;
float:left;
margin:0;
padding:0
}
#primary_nav_wrap ul li.current-menu-item
{
background:#ddd
}
#primary_nav_wrap ul li:hover
{
background:#f6f6f6
}
#primary_nav_wrap ul ul
{
display:none;
position:absolute;
top:100%;
left:0;
background:#fff;
padding:0
}
#primary_nav_wrap ul ul li
{
float:none;
width:200px
}
#primary_nav_wrap ul li:hover > ul
{
display:block
}
<h1>Simple Pure CSS Drop Down Menu</h1>
<nav id="primary_nav_wrap">
<ul>
<li class="current-menu-item">Home</li>
<li>Menu 1
<ul>
<li>Sub Menu 1</li>
<li>Sub Menu 2</li>
<li>Sub Menu 3</li>
<li>Sub Menu 4
<ul>

CSS Dropdown-menu not displaying when <li>-element is hovered.

I have a top navigation bar with 4 options, where I wish that while the fourth option is hovered, a dropdown-menu will display.
The navigation bar is an unordered list, and the dropdown-menu (which should be activated by the fourth option) is a div consisting of 3 links.
The list item that is supposed to display the dropdown-menu while hovered:
<li class="dropdownbutton">Contact</li>
With the help of this line of code:
.dropdownbutton:hover .dropdowncontent {
display:inline-block;
}
And this is the CSS for the dropdown-content:
.dropdowncontent {
display:none;
background-color:#333;
margin-left:272px;
width:90px;
text-align:center;
}
What am I missing?
This should be allright.
ul {
margin: 0;
padding: 0;
list-style: none;
background-color: #333;
}
ul li {
display: inline-block;
position: relative;
text-align: left;
background-color: #333;
}
ul li a {
display: block;
color: #f2f2f2;
text-align: center;
padding: 16px 15px;
text-decoration: none;
transition-duration: 0.3s;
-webkit-transition-duration: 0.3s;
font-size: 17px;
font-family: Arial;
}
ul li a:hover {
background-color: #555;
}
ul li ul.dropdown {
min-width: 100%;
display: none;
position: absolute;
z-index: 999;
left: 0;
width: 90px;
}
ul li:hover ul.dropdown {
display: block;
}
ul li ul.dropdown li {
display: block;
}
ul li ul.dropdown li a {
font-size: 14px;
padding: 10px 15px;
}
<ul>
<li>Home</li>
<li>About Us</li>
<li>Products</li>
<li>Contact
<ul class="dropdown">
<li>Option 1</li>
<li>Option 2</li>
<li>Option 3</li>
</ul>
</li>
</ul>

CSS horizontal menu , add class selector in CSS cause the submenu off position

I want to create a horizontal two level menu navigation. I copied some code on Internet and work fine. Below is the original CSS style and HTML
<style>
/*Style for horizontal CSS menu*/
ul {
list-style-type: none;
position: absolute;
margin: 0;
padding: 0;
}
ul li {
float: left;
margin-right: 1px;
display: inline-block;
}
ul li a {
display: block;
text-decoration: none;
height: 18px;
min-width: 120px;
text-align: center;
line-height: 18px;
font-family: Arial, "Times New Roman", Georgia;
color: #ffffff;
background: #004080;
font-size: 12px;
}
ul li:hover a {
background: #FFC062;
}
ul li:hover ul a {
background: #d9efff;
color: #2f3036;
line-height: 18px;
height: 18px;
}
ul li:hover ul a:hover {
background: #7db0db;
color: #ffffff;
}
ul li ul {
display: none;
}
ul li ul li {
display: block;
float: none;
border-left: 1px solid #000;
border-right: 1px solid #000;
border-bottom: 1px solid #000;
}
ul li ul li:first-child {
display: block;
float: none;
border-top: 1px solid #000;
}
ul li ul li a {
width: auto;
min-width: 120px;
padding: 0 15px;
text-align: left;
color: #000;
}
ul li a:hover + .sub-menu,
.sub-menu:hover {
display: block;
}
</style>
<ul id="hor-menu" class="menu">
<li style="width:142px">
Home
<ul class="sub-menu">
<li>Country 1
</li>
<li>Country 1
</li>
<li>Country 1
</li>
</ul>
</li>
<li style="width:130px">
Main Menu 2
<ul class="sub-menu">
<li>Sub Menu
</li>
<li>Sub Menu
</li>
</ul>
</li>
<li style="width:130px">
Main Menu 2
<ul class="sub-menu">
<li>Sub Menu
</li>
<li>Sub Menu
</li>
</ul>
</li>
</ul>
Since the CSS is on the standard ul and li element so I want to add a class selector so that it only affect the horizontal menu. So I append .menu to each ul style. However the submeun will become off the position of the main menu. Any idea which style go wrong?
<style>
/*Style for horizontal CSS menu*/
ul.menu {
list-style-type: none;
position: absolute;
margin: 0;
padding: 0;
}
ul.menu li {
float: left;
margin-right: 1px;
display: inline-block;
}
ul.menu li a {
display: block;
text-decoration: none;
height: 18px;
min-width: 120px;
text-align: center;
line-height: 18px;
font-family: Arial, "Times New Roman", Georgia;
color: #ffffff;
background: #004080;
font-size: 12px;
}
ul.menu li:hover a {
background: #FFC062;
}
ul.menu li:hover ul a {
background: #d9efff;
color: #2f3036;
line-height: 18px;
height: 18px;
}
ul.menu li:hover ul a:hover {
background: #7db0db;
color: #ffffff;
}
ul.menu li ul {
display: none;
}
ul.menu li ul li {
display: block;
float: none;
border-left: 1px solid #000;
border-right: 1px solid #000;
border-bottom: 1px solid #000;
}
ul.menu li ul li:first-child {
display: block;
float: none;
border-top: 1px solid #000;
}
ul.menu li ul li a {
width: auto;
min-width: 120px;
padding: 0 15px;
text-align: left;
color: #000;
}
ul.menu li a:hover + .sub-menu, .sub-menu:hover {
display: block;
}
</style>
<ul id="hor-menu" class="menu">
<li style="width:142px">
Home
<ul class="sub-menu">
<li>Country 1
</li>
<li>Country 1
</li>
<li>Country 1
</li>
</ul>
</li>
<li style="width:130px">
Main Menu 2
<ul class="sub-menu">
<li>Sub Menu
</li>
<li>Sub Menu
</li>
</ul>
</li>
<li style="width:130px">
Main Menu 2
<ul class="sub-menu">
<li>Sub Menu
</li>
<li>Sub Menu
</li>
</ul>
</li>
</ul>
Check this out- you have missed some styles that need to be applied to sub-menu also. Guess you can figure it out now. Thanks!
/*Style for horizontal CSS menu*/
ul.menu, ul.sub-menu {
list-style-type: none;
position: absolute;
margin: 0;
padding: 0;
}
ul.menu li, ul.sub-menu li {
float: left;
margin-right: 1px;
display: inline-block;
}
ul.menu li a, ul.sub-menu li a {
display: block;
text-decoration: none;
height: 18px;
min-width: 120px;
text-align: center;
line-height: 18px;
font-family: Arial, "Times New Roman", Georgia;
color: #ffffff;
background: #004080;
font-size: 12px;
}
ul.menu li:hover a, ul.sub-menu li:hover a {
background: #FFC062;
}
ul.menu li:hover ul a {
background: #d9efff;
color: #2f3036;
line-height: 18px;
height: 18px;
}
ul.menu li:hover ul a:hover {
background: #7db0db;
color: #ffffff;
}
ul.menu li ul {
display: none;
}
ul.menu li ul li {
display: block;
float: none;
border-left: 1px solid #000;
border-right: 1px solid #000;
border-bottom: 1px solid #000;
}
ul.menu li ul li:first-child {
display: block;
float: none;
border-top: 1px solid #000;
}
ul.menu li ul li a {
width: auto;
min-width: 120px;
padding: 0 15px;
text-align: left;
color: #000;
}
ul.menu li a:hover + .sub-menu,
.sub-menu:hover {
display: block;
}
<ul id="hor-menu" class="menu">
<li style="width:142px">
Home
<ul class="sub-menu">
<li>Country 1
</li>
<li>Country 1
</li>
<li>Country 1
</li>
</ul>
</li>
<li style="width:130px">
Main Menu 2
<ul class="sub-menu">
<li>Sub Menu
</li>
<li>Sub Menu
</li>
</ul>
</li>
<li style="width:130px">
Main Menu 2
<ul class="sub-menu">
<li>Sub Menu
</li>
<li>Sub Menu
</li>
</ul>
</li>
</ul>