How do i make a drop down menu appear when a link is hovered

If the user’s logged in i wanna display his name and when the name is
hovered or clicked i want a menu to appear and wanna do this using
Must the element be linked to a menu or can the element be part of the
like the title