I am facing an issue with an absolutely positioned div that I want to stretch the full width of the screen using 100vw
. However, the problem is that it aligns with its parent's starting point rather than the left side of the viewport. How can I make sure the element starts from left to right?
.main-navigation li {
float: left;
position: relative;
height: 100%;
display: flex;
}
.nav-dropdown {
display: none;
left: 0;
top: 50px;
position: absolute;
background-color: #ebebeb;
z-index: 2;
height: 300px;
}
<li id="menu-item-120" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-has-children menu-item-120">
<a class="nav-titles" href="http://localhost/wp/checkout/">Clothes</a>
<div class="nav-dropdown"></div>
</li>
E: Here is the code snippet. The specific div in question is referred to as .nav-dropdown
.