I have implemented a navbar using the code below, which aligns well from the right side. However, the menu items are sorted in ltr
order and I need them to be in rtl
order, so that "Dropdown 1" starts from the right side of the page.
Currently, it appears as:
https://i.stack.imgur.com/9spbu.jpg
And it should look like this:
https://i.stack.imgur.com/vHFLX.jpg
- I attempted adding
float: right
but since it's already applied in the bootstrap CSS, and also tried usingdir="rtl"
in the HTML/body/div elements, but with no success. - Furthermore, I am trying to identify the
@media
rule in the CSS that hides the menu on smaller screens. I added
in the CSS, but the menu remains hidden on smaller frames (I suspect it's related to the@media (min-width: 200px !important)
@media (min-width: 768px)
in the bootstrap.min.css file).
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Meta, title, CSS, favicons, etc. -->
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bootstrap Dropdown Hover</title>
<!-- Bootstrap core CSS -->
<link href="https://kybarg.github.io/bootstrap-dropdown-hover/assets/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<!-- Bootstrap Dropdown Hover CSS -->
<link rel="stylesheet" href="https://kybarg.github.io/bootstrap-dropdown-hover/assets/bootstrap-dropdownhover/css/animate.min.css">
<link rel="stylesheet" href="https://kybarg.github.io/bootstrap-dropdown-hover/assets/bootstrap-dropdownhover/css/bootstrap-dropdownhover.min.css">
</head>
<body>
<div class="bs-demo-showcase">
<nav class="navbar navbar-material-blue navbar-fixed-top" role="navigation">
<div class="container">
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-animations" data-hover="dropdown" data-animations="fadeInDownNew fadeInRightNew fadeInUpNew fadeInLeftNew">
<ul class="nav navbar-nav navbar-right">
<li class="dropdown">
<a href="#" class="dropdown-toggle" role="button" aria-expanded="false">Dropdown 1<span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
<li><a href="#">Action</a></li>
<li><a href="#">Another action</a></li>
<li class="dropdown">
<a href="#">Another dropdown <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="#">Action</a></li>
<li><a href="#">Another action</a></li>
<li><a href="#">Something else here</a></li>
<li class="divider"></li>
<li><a href="#">Separated link</a></li>
<li class="divider"></li>
<li><a href="#">One more separated link</a></li>
</ul>
</li>>
...
P.S. To view the above snippet properly, use the "Full page" option or utilize jsfiddle by enlarging the results frame: https://jsfiddle.net/gtfmbc54/1/