How to change position of dropdown box

Hi there, I’m learning to write css for a site. I maded a dropdown menu with triangle. But that arrow skewed and I don’t know how to move it to center of that link. Thanks for your help <3

45507636_305244656748508_2777578508786860032_n

Hi @dung251997, could you post a link to the code or possibly a codepen/jsfiddle showing the issue?

1 Like

wait a minute <3…

@dung251997, make sure your dropdown menu is absolute positioned relative to the link. Then it will be very easy to control position of your dropdown

2 Likes

I’m using sublime to code, but it’s got error when I paste on codepen :frowning:

so the link should be relative ?

Yes, link relative and dropdown should be a child

1 Like

How can I select dropdown and dropdown-menu ?

As you might have multiple dropdown menus, I would suggest giving them unique ID, like explorerDropdown and explorerDropdownMenu, if you want to select them in CSS. In JS you don’t really need it, as they ‘will be selected by user’ on click event and you can do generic:

e.target.closest('.dropdown-menu').classList.add('open')

It looks like you use some sort of framework though, probably Bootstrap, that should do this for you I guess

1 Like

Ok, thanks for you help :smiley: