I'll start by answering the second part of your question.
When creating this button, the drop-down menu has no color when you hover
Chrome dev-tools (right-click on any element of the page and select the Inspect element ), which can help a lot when it comes to style elements in certain states (for example, hovering). To see which style rule is applied during hover, we can force the button on the button to be imposed using dev-tools . We see .btn-default applying
.btn-default:hover { color: #333; background-color: #e6e6e6; border-color: #adadad; }
Since this button has the following class priority <button class="btn btn-default btn-lg dropdown-toggle filterOptions"> (classes on the right override rules from classes to the left) We can redefine the hover styles .btn-default by creating a rule for the filterOptions hover filterOptions .
.filterOptions:hover { background-color: white; border-color: #ccc; }
Adjusting the position of the menu as well
Again, looking at the dropdown in dev-tools, we can see that the correct style rule for overriding the default position and creating a dropdown on the right is:
.open>.dropdown-menu { right: 0; left: initial; }
Updated fiddle: https://jsfiddle.net/tfrpncu7/4/
Remember that css has no idea what it was always a good idea to always use new classes other than bootstrap when styling a specific element. If your project is large, consider using a css naming convention like BEM to reduce the risk of naming collisions.
source share