I have a multilevel dropdown menu created in Bootstrap 4. I want to display the dropdown submenu on the right side of the parent dropdown. I have aligned the menu to the right but that's not what I want. How to display the dropdown submenu on the right side instead of right aligned ?
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"></script>
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" rel="stylesheet" />
<nav class="navbar navbar-custom navbar-expand-md bg-dark navbar-dark">
<button class="navbar-toggler" data-toggle="collapse" data-target="#collapse_target">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="collapse_target">
<ul class="navbar-nav">
<li class="nav-item dropdown">
<a class="nav-link" data-toggle="dropdown" data-target="#dropdown_target" href="#">
DEPARTMENTS
</a>
<ul class="dropdown-menu" aria-labelledby="dropdown_target">
<li class="dropdown-item dropdown">
<a data-toggle="dropdown" data-target="#auto_en" href="#">Automobile Engineering</a>
<ul class="dropdown-menu dropdown-menu-right" aria-labelledby="auto_en">
<li class="dropdown-item"><a href="#">HOD's Desk</a>
</li>
<li class="dropdown-item"><a href="#">About Us</a></li>
<li class="dropdown-item"><a href="#">Faculty</a></li>
<li class="dropdown-item"><a href="#">Events</a></li>
<li class="dropdown-item"><a href="#">Class
Timetable</a></li>
<li class="dropdown-item"><a href="#">Results</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</nav>
Here, the submenu of Automobile Engineering is -HOD's Desk -About Us -Faculty.... I want this submenu to be displayed on right side of the parent submenu which contains automobile engineering.
I have used dropdown-menu-right bootstrap class but that aligns the menu to the right and doesn't display it outside the parent menu.
Thanks.