5
I added an arrow to my dropdown menus from Bootstrap 3, but I’m having trouble positioning Arrow correctly below the dropdown-toggle
, below is a demo image:
On the left is my current scenario, with Arrow poorly positioned (right: 45%
). On the right is how I’d like to leave.
Can anyone help me in 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: '';
}
@Cersuumt Gave an edited reply because it seems to me to be a reply indeed, and not just a comment. :)
– Victor Stafusa
Okay, thank you =D I also improved the explanation a little, I forgot to mention the purpose of the 'px''
– celsomtrindade
Thanks for the help, @celsomtrindade. A few days ago I also took this "solution", I’m putting css inline
right: x%
in every dropdown I make, but I don’t intend to continue this for long.– Eduardo Silva