I added an arrow to my Bootstrap 3 dropdown menus, but I'm having trouble positioning the arrow correctly below dropdown-toggle
, below is a demo image:
On the left is my current scenario, with the badly positioned arrow ( right: 45%
). On the right is how I would like to leave.
Can anyone help me with this? Below my CSS code:
.dropdown-menu:before {
position: absolute;
top: -7px;
right: 45%;
display: inline-block;
border-right: 7px solid transparent;
border-bottom: 7px solid #ccc;
border-left: 7px solid transparent;
border-bottom-color: rgba(0, 0, 0, 0.2);
content: '';
}
.dropdown-menu:after {
position: absolute;
top: -6px;
right: 45%;
display: inline-block;
border-right: 6px solid transparent;
border-bottom: 6px solid #ffffff;
border-left: 6px solid transparent;
content: '';
}