I\'m using Twitter Bootstrap and some custom css (found here) to have dropdown menus open up on mouseover.
I am using the \"caret\" on a on the root menu items to show
As user2661940 said you can use glyphicons for Bootstrap 3 or you can also make your own class for every side. For example
.caret-right {
display: inline-block;
width: 0;
height: 0;
margin-left: 2px;
vertical-align: middle;
border-left: 4px solid;
border-bottom: 4px solid transparent;
border-top: 4px solid transparent;
}
I added a rotation class to the span
HTML:
<span class="rotate270 caret"></span>
CSS:
.rotate270 {
-webkit-transform: rotate(-90deg);
-moz-transform: rotate(-90deg);
-o-transform: rotate(-90deg);
-ms-transform: rotate(-90deg);
transform: rotate(-90deg);
}
You can obviously create other angle classes as desired.
Use the bootstrap (3.0) Glyphicons
<span class="glyphicon glyphicon-chevron-up"></span> <!-- UP -->
<span class="glyphicon glyphicon-chevron-down"></span> <!-- DOWN-->
you can use simple code:
HTML
<span class="caret"></span>
CSS:
.caret{
border-color:#ffffff transparent transparent transparent;
border-width:4px;
border-style:solid;
content: ""
display:inline-block;
}
I use these styles to do that (it works without bootstrap as well)
HTML:
<span class="caret up"></span>
<span class="caret right"></span>
<span class="caret down"></span>
<span class="caret left"></span>
CSS:
.caret {
border: 5px solid transparent;
display: inline-block;
width: 0;
height: 0;
opacity: 0.5;
vertical-align: top;
}
.caret.up {
border-bottom: 5px solid;
}
.caret.right {
border-left: 5px solid;
}
.caret.down {
border-top: 5px solid;
}
.caret.left {
border-right: 5px solid;
}
Just add the css to rotate the caret on mouse hover
.navbar-nav>li>.dropdown-menu{
display:block;
visibility:hidden;
}
.navbar-nav>li:hover>.dropdown-menu{
visibility:visible;
}
.navbar-default .navbar-nav>li:hover>a .caret{
transform:rotate(-90deg);
transition:all 0.3s ease-in-out;
}