Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dropdown list to appear outside div

Tags:

css

I have a main horizontal menu inside a div. I want the dropdown menu to appear right underneath the div. Now it just expands the div when the dropdown is visible. How can I make the dropdown go outside the div?

like image 914
user3496563 Avatar asked Aug 07 '26 15:08

user3496563


1 Answers

try with the div position:relative and the dropdown menus position:absolute

HTML

<div class="drop-down-container">

<div class="drop-down">

  //Your drop-down code


</div>

</div>

CSS

.drop-down-container
{
position:relative;
}

.drop-down
{
position:absolute;
}
like image 53
Krish Avatar answered Aug 16 '26 23:08

Krish