Hi jerrizzy. Welcome to SitePoint.
TextEdit doesn't display HTML by default, since it's a rich text editor. So firstly, with TextEdit launched, go to TextEdit > Preferences. At the top of the Preferences box that then opens, there are two tabs—"New Document" and "Open and Save".
Under New Document, choose Format: Plain text.
Under Open and Save, choose "ignore rich text commands in HTML files", deselect "Add .txt extension to plain text files" (and manually type .html as an extension when you create and save a file).
Also, under HTML Saving Options, choose HTML 4.01 Strict as the Document type and Unicode (UTF-8) as the Encoding. Also make sure "Preserve white space" is selected.
That should fix things.