I want to write an html document like this :
<html>
<body>
<h1>My First Heading</h1>
</body>
</html>
I wrote it and saved it in my desktop with the name hello.html , but when I open this file with firefox or safari, the browser shows the whole text (including <html> and all of the texts) instead of only showing my first heading!
what’s the problem?
The problem was that I wrote the HTML document with “Text Edit” application, and it saved the file with
.rtfextension, that is not plain text, so changing the name of file tohello.htmldidn’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->preferencesand tick theplain textat top of the page, then when you save something, it is saved as plain text2) you can use some text editor, like lime edit