Intenté bajar la parte desplegable a partir de donde termina el nav, lo logré, pero el resto de menús(menu2, menu3, menu4,...) se siguen corriendo hacia la derecha. En dónde está el error?
@import url('https://fonts.googleapis.com/css?family=Quicksand');
* {
box-sizing: border-box;
font-family: 'Quicksand';
}
ul {
margin: 0;
padding: 0;
list-style-type: none;
}
a {
display: block;
padding: .2rem 0;
color: #000;
font-size: .875rem;
text-decoration: none;
}
a:hover {
color: rgb(235, 161, 24);
text-decoration: none;
}
h4 {
margin: .5rem 0 .75rem;
padding-bottom: .5rem;
border-bottom: 1px solid #ddd;
font-size: 1.25rem;
font-weight: normal;
}
h5 {
margin: 0;
margin-bottom: .5rem;
font-size: .875rem;
}
nav {
display: flex;
background-color: #2c3040;
}
nav::after {
content: '';
display: block;
clear: both;
}
.menu-submenu {
display: inline-block;
border-radius: .2rem;
background: #2c304038;
position: relative;
z-index: 2;
margin-right: 30px;
}
/* .menu-submenu:hover {
position: absolute;
} */
.subregion {
margin-top: 40px;
}
.menu-submenu:hover>li {
display: block;
}
.menu-submenu:hover>li:first-child {
border-color: transparent;
border-bottom: none;
box-shadow: none;
position: relative;
z-index: 1;
color: rgb(235, 161, 24);
cursor: default;
}
/* .menu-submenu:hover>li:first-child::after {
content: '\f106';
} */
.menu-submenu:hover>li:last-child {
border-radius: 0 0 .2rem .2rem;
}
.menu-submenu:hover+.temp::after {
display: block;
}
.menu-submenu>li {
background-color: #2c3040;
display: none;
width: auto;
margin: 0;
}
.menu-submenu>li:first-child {
display: block;
padding: .65rem;
background: #2c3040;
color: white;
font-size: .875rem;
cursor: pointer;
}
/* .menu-submenu>li:first-child::after {
content: '\f107';
float: right;
} */
.menu-submenu>li:not(:first-child):hover {
width: calc(960px - 6rem);
border-right: none;
}
.menu-submenu>li:nth-child(2):hover::before {
/* content: ''; */
display: block;
width: 12rem;
height: 3rem;
border: 1px solid transparent;
position: absolute;
top: 0;
z-index: 10;
}
li h3 {
width: 12rem;
margin: 0;
padding: .65rem .75rem;
border: 1px solid transparent;
border-width: 1px 0;
background: #fff;
position: relative;
z-index: 10;
font-size: .875rem;
font-weight: normal;
cursor: default;
}
li:last-child:hover h3 {
border-bottom-color: transparent;
border-radius: 0 0 0 .2rem;
}
li:hover h3 {
width: calc(12rem + 1px);
border-color: #bbb;
}
li:hover div {
display: block;
}
li div {
display: none;
width: calc(850px - 6rem - 12rem);
padding: 1rem 1.2rem;
border-left: 1px solid #bbb;
border-radius: 0 .2rem .2rem 0;
background: #fff;
position: absolute;
top: 0;
bottom: 0;
left: 12rem;
z-index: 1;
}
.temp {
display: flex;
width: 72%;
border-radius: .2rem;
float: right;
font-size: .875rem;
}
.temp::after {
content: '';
display: none;
background: rgba(0, 0, 0, 0);
position: fixed;
top: 0;
bottom: 0;
right: 0;
left: 0;
}
.temp li {
padding: .65rem 0;
flex: 1;
text-align: center;
cursor: pointer;
}
main {
display: flex;
width: 100%;
height: 15rem;
margin-top: 2rem;
padding: 1rem;
background: #ccc;
position: relative;
z-index: 1;
clear: both;
}
main p {
margin: auto;
color: #555;
text-transform: uppercase;
letter-spacing: 1px;
}
@media (max-width: 60rem) {
.temp {
width: 67%;
}
}
<nav>
<ul class="menu-submenu">
<li id>acerca de <i class="fas fa-angle-down"></i></li>
<li>
<h3>1</h3>
<div class="subregion">
<h4>1</h4>
<ul>
<li id="obando" style="float:right"><img src="https://es-static.z-dn.net/files/dcc/c91ce8b034207ce60fcf1b4f6d73ce73.jpg" alt="Mapa Nariño"></li>
<li><a href="#">a</a></li>
<li><a href="#">b</a></li>
<li><a href="#">c</a></li>
<li><a href="#">d</a></li>
</ul>
</div>
</li>
<li>
<h3>2</h3>
<div class="subregion">
<h4> 2</h4>
<ul>
<li><a href="#">a</a></li>
<li><a href="#">b</a></li>
<li><a href="#">c</a></li>
<li><a href="#">d</a></li>
</ul>
</div>
</li>
<li>
<h3>3</h3>
<div class="subregion">
<h4>3</h4>
<ul>
<li><a href="#">a</a></li>
<li><a href="#">b</a></li>
<li><a href="#">c</a></li>
<li><a href="#">d</a></li>
</ul>
</div>
</li>
</ul>
<ul class="menu-submenu">
<li id>Menu2</li>
</ul>
<ul class="menu-submenu">
<li id>Menu3</li>
</ul>
<ul class="menu-submenu">
<li id>Menu4</li>
</ul>
<ul class="menu-submenu">
<li id>Menu5</li>
</ul>
</nav>