Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Thumbz

macrumors newbie
Original poster
Mar 3, 2011
2
0
I made a simple .html file and ran it and instead of running the simple
<html>
<head><title> Hello world</title></head>
<body> Hello again </body>
</html>

(not actual code)

it just prints it. Does anyone know why it does this and how to fix it? I'm taking an html class and I can't do anything without learning how to fix this problem. I double checked everything for the .html extension, here's a screenshot. (http://i.imgur.com/jcfX9.png)

Thanks for any and all help!
 
Depending on editor it might save text files with a hidden .txt extension. Do cmd+I on the file and change file.html.txt to file.html
 
Depending on editor it might save text files with a hidden .txt extension. Do cmd+I on the file and change file.html.txt to file.html
This sounds most likely to me. Myself and countless other people who develop websites on OSX can attest that it can and does work fine.

I'd recommend grabbing yourself a copy of TextWrangler (it's free from Barebones direct or the Mac App store)--very nice text editor, decent support for HTML source coloring, and it's very explicit about what character encoding it's using and how it saves files.
 
Does it do this if you open it in Safari or Firefox - if so, it's probably the hidden extension thing mentioned above. If not, it's probably a Chrome setting.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.