Do you have a page we can look at, like a Codepen?
I don’t see anything in the code you posted that would make the list be where it is so I’m guessing there is something else going on. Or some elements are not closed correctly but we can’t see that because of the code formatting (forum code formatting).