html files to open with TextEdit, instead of choosing Open With you should choose Get Info which reveals the following: Notice the Open with area in the Get Info window. TextEdit, which works with files in a rich text format by default, must be in plain text mode to write or edit HTML This is how you can use textedit in Mac to edit html files. With it, and a knowledge of HTML, you can write and edit HTML code. The TextEdit program ships with all Mac computers.
If you have a Mac, you don't need to download an HTML editor to write or edit HTML for a web page. Home TextEdit Mac HTML not working How to Edit HTML With TextEdit on a Mac - ThoughtCo