This post is about creating Dropdown boxes in html.
<html>
<head>
<title> DropDown</title>
<style media="screen" type="text/css">
.clearfix:after {
display:block;
clear:both;
}
/*----- Menu Outline -----*/
.menu a {
transition:all linear 0.15s;
color:#919191;
}
.menu .arrow {
font-size:11px;
line-height:0%;
}
/*----- Top Level -----*/
.menu > ul > li {
float:left;
display:inline-block;
position:relative;
font-size:19px;
}
.menu > ul > li > a {
padding:10px 40px;
display:inline-block;
text-shadow:0px 1px 0px rgba(0,0,0,0.4);
}
.menu > ul > li:hover > a, .menu > ul > .current-item > a {
background:#2e2728;
}
/*----- Bottom Level -----*/
.menu li:hover .sub-menu {
z-index:1;
opacity:1;
}
.sub-menu {
width:160%;
padding:5px 0px;
z-index:-1;
opacity:0;
transition:opacity linear 0.15s;
box-shadow:0px 2px 3px rgba(0,0,0,0.2);
background:#2e2728;
}
.sub-menu li {
display:block;
font-size:16px;
}
.sub-menu li a {
padding:10px 30px;
display:block;
}
.sub-menu li a:hover, .sub-menu .current-item a {
color:red;
background:#3e3436;
}
</style>
</head>
<body>
<nav class="menu">
<ul class="clearfix">
<li>
<a href="#">Animals <span class="arrow">▼</span></a>
<ul class="sub-menu">
<li><a href="#">Reptiles</a></li>
<li><a href="#">Insects</a></li>
<li><a href="#">Mammals</a></li>
</ul>
</li>
</ul>
</nav>
</body>
</html>
Post any problem and suggestion in the comments.
Share the post and like us on Facebook.
Hitesh Bhatia
Editor in chief
<html>
<head>
<title> DropDown</title>
<style media="screen" type="text/css">
.clearfix:after {
display:block;
clear:both;
}
/*----- Menu Outline -----*/
.menu a {
transition:all linear 0.15s;
color:#919191;
}
.menu .arrow {
font-size:11px;
line-height:0%;
}
/*----- Top Level -----*/
.menu > ul > li {
float:left;
display:inline-block;
position:relative;
font-size:19px;
}
.menu > ul > li > a {
padding:10px 40px;
display:inline-block;
text-shadow:0px 1px 0px rgba(0,0,0,0.4);
}
.menu > ul > li:hover > a, .menu > ul > .current-item > a {
background:#2e2728;
}
/*----- Bottom Level -----*/
.menu li:hover .sub-menu {
z-index:1;
opacity:1;
}
.sub-menu {
width:160%;
padding:5px 0px;
z-index:-1;
opacity:0;
transition:opacity linear 0.15s;
box-shadow:0px 2px 3px rgba(0,0,0,0.2);
background:#2e2728;
}
.sub-menu li {
display:block;
font-size:16px;
}
.sub-menu li a {
padding:10px 30px;
display:block;
}
.sub-menu li a:hover, .sub-menu .current-item a {
color:red;
background:#3e3436;
}
</style>
</head>
<body>
<nav class="menu">
<ul class="clearfix">
<li>
<a href="#">Animals <span class="arrow">▼</span></a>
<ul class="sub-menu">
<li><a href="#">Reptiles</a></li>
<li><a href="#">Insects</a></li>
<li><a href="#">Mammals</a></li>
</ul>
</li>
</ul>
</nav>
</body>
</html>
Post any problem and suggestion in the comments.
Share the post and like us on Facebook.
Hitesh Bhatia
Editor in chief
Comments
Post a Comment