Navid777 Navid777 - 1 year ago 79
HTML Question

Browser shows plain text instead of HTML in mac

I want to write an html document like this :


<h1>My First Heading</h1>


I wrote it and saved it in my desktop with the name
, but when I open this file with firefox or safari, the browser shows the whole text (including
and all of the texts) instead of only showing
my first heading
what's the problem?

Answer Source

The problem was that I wrote the HTML document with "Text Edit" application, and it saved the file with .rtf extension, that is not plain text, so changing the name of file to hello.html didn't change anything.

there are two ways to fix this problem:

1) if you insist on using "Text Edit" you should go to text edit->preferences and tick the plain text at top of the page, then when you save something, it is saved as plain text

2) you can use some text editor, like lime edit