0
我想在HTML中創建子菜單。在這裏,我創建了菜單和子菜單,但它出現在左側,我想要下面的子菜單。請幫我this.i想要的子菜單中打開向下的一面,當光標放在它下面是關於它的CSS和HTML下拉菜單顯示在左側而不是下側作爲子菜單
/* header */
#templatemo_header_wrapper {
width: 100%;
height: 82px;
background: url(images/templatemo_header.png) repeat-x;
}
#templatemo_header {
width: 910px;
height: 52px;
padding: 15px;
margin: 0 auto;
}
/* site title */
#site_title {
float: left;
padding: 10px 0 0 0;
}
#site_title a {
margin: 0px;
padding: 0px;
font-size: 26px;
color: #ffffff;
font-weight: normal;
text-decoration: none;
}
#site_title h1 a:hover {
font-weight: bold;
text-decoration: none;
}
#site_title a span {
display: block;
margin-top: 5px;
color: #fff;
font-size: 11px;
text-align: center;
}
#templatemo_menu {
float: left;
height: 37px;
margin-top: 12px;
overflow: hidden;
position: relative;
}
#templatemo_menu ul {
margin: 0;
padding: 0;
list-style: none;
}
#templatemo_menu ul li {
padding: 0;
margin: 0;
display: inline;
}
#templatemo_menu ul li a {
float: left;
display: inherit;
height: 28px;
width: 100px;
margin-left: 0px;
padding: 8px 0 0 0;
text-align: center;
font-size: 13px;
font-weight: bold;
text-decoration: none;
color: #fff;
outline: none;
}
#templatemo_menu li a:hover,
#templatemo_menu li .current {
background: url(images/menu_hover.png) no-repeat;
}
#templatemo:hover .dropdown-content {
display: block;
}
/* end of menu */
/* end of header */
/* feature */
#templatemo_feature_wrapper {
width: 100%;
height: 266px;
background: url(images/templatemo_feature_bg.png) repeat-x;
}
#templatemo_feature {
width: 910px;
height: 216px;
padding: 40px 15px;
margin: 0 auto;
color: #fff;
}
#feature_left {
float: left;
width: 440px;
}
#feature_left p {
text-align: justify;
}
#feature_right {
float: right;
width: 400px;
}
#feature_right #feature_image {
position: relative;
width: 400px;
height: 173px;
padding: 10px;
}
#feature_right #feature_image span {
position: absolute;
top: 0;
left: 0;
width: 420px;
height: 193px;
background: url(images/template_feature_image.png) no-repeat;
}
/* end of feature */
#templatemo_content_wrapper {
width: 900px;
margin: 0 auto;
padding: 30px 15px;
}
#templatemo_content {
float: left;
width: 660px;
}
#templatemo_sidebar {
float: right;
width: 200px;
padding: 0px 0px;
}
.col_w200 {
width: 150px;
padding: 30px;
}
#gallery img:hover {
-webkit-transform: scale(1.5);
/*Webkit: increase size to 1.5x*/
opacity: 1;
/*default opacity*/
z-index: 10;
/*place hover image in front the non-hover images*/
}
.templatemo_menu {
position: relative;
display: inherit;
}
.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: #fff
}
.templatemo_menu .dropdown-content {
display: none;
}
.templatemo_menu:hover .dropdown-content {
display: block;
}
.dropdown:hover .dropbtn {
background-color: #3e8e41;
}
<div id="templatemo_menu">
<ul>
<li><a href="#" class="current">Home</a></li>
<li class="templatemo_menu"><a href="Aboutus.html" class="dropbtn">Coindia</a>
<div class="dropdown-content"> <a href="#">Link 1</a> <a href="#">Link 2</a> <a href="#">Link 3</a> </div>
</li>
<li><a href="http://www.flashmo.com" target="_parent">Services</a></li>
<li><a href="http://www.koflash.com" target="_parent">Facility</a></li>
<li><a href="#">Photo Gallery</a></li>
<li><a href="#">Careers</a></li>
<li><a href="#">Contact Us</a></li>
<li><a href="#">News & Events</a></li>
</ul>
</div>
<!-- end of templatemo_menu -->