You have mis-matched tags, a closing li without an opening one. It would be easier to spot if you separated it a bit more. For example,
<li><a href="#">Item B</a></li><ul> << put this opening ul on the next line
I assume you've closed the opening div further down the page.