You need to take a very close look at the way in which you form your HTML, as it's not ideal. I'd suggest you make use of the W3C's Validation Markup Service. As you're only dealing with a snippet of HTML, just use the 'Validate by Direct Input' tab, then select "HTML 5 (experimental)" as your doctype under the 'Options' menu.
Some of the result are because what you've posted is not a complete HTML document, and you can safely ignore those for now. What you do need to look at though are those errors it describes as "Garbage" and fix them; it's mostly down to spaces appearing in your tags where they're not needed.
Lastly, you should be consistent with your capitalisation of your HTML tags. Whilst you don't need to worry that a browser will ignore or misread them , they're very tolerant these days, for readability's sake, I'd recommend sticking to all lowercase. That's 'best practice' these days, and the random introduction of capital letters does nothing to aid readability, and highlights your inexperience with the use of HTML.