the way i'd do it is having a style tag withÂ
<style>
nav:hover {
translate 20px 10px;
}
</style>
where the 20px moves it right 20 and 10px moves it up by 10 on hover (replace nav with the selector of what you want to move)
replace one of the numbers with 0 if you want it to only go in one direction
to smooth it out there's the animate tag and everything but that's the basic method iirc