On a Mac, I created a .html document locally but in a browser I just see HTML source
Shad was actually on to the right answer here.
The problem was that I was using the standard mac text editor - textedit
- and it was saving the document type as rich text formatting (the standard). I had to go into textedit preferences and make change the default formatting for a new document from Rich text to Plain text. This fixed the problem!
As this was a stupid problem, yet not obvious to most I'll post the screen shot of where you change that default new document preference in textedit prefs.
Comments
-
junky almost 2 years
On a Mac, I created a file with some very simple html, e.g.
<h1>my web page</h1>
I save it as .html. I start firefox or Opera and I use open file, but I just see the content as html source, e.g. I see<b>
tags, etc.If you want all the code here it is:
<html> <head> </head> <body> <h1>My Web Page</h1> </body> </html>
Edit: 'Rich text' format was the issue. See my answer below.
-
junky about 12 yearsThanks. Yes I did this and it didn't help. i tried .html .htm and no extension and I check each one with finder properties, none are working.
-
junky about 12 years-1 because I did not see the .txt so this was not a fix (though I appreciate the help as always).
-
junky about 12 yearsTotally makes sense. I can change the extension but that isn't this. How do I actually change the header information ?
-
stanimirsp over 3 yearsIt works, need only to add that these settings won’t take effect on the current work. New html file must be created.