Html files don't work on Mac?

Discussion in 'Mac Basics and Help' started by Thumbz, Aug 25, 2011.

  1. Thumbz macrumors newbie

    Joined:
    Mar 3, 2011
    #1
    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!
     
  2. blevins321 macrumors 68030

    Joined:
    Dec 24, 2010
    Location:
    Winnipeg, MB
    #3
    Does taking out the doctype line make it display correctly?
     
  3. Hansr macrumors 6502a

    Joined:
    Apr 1, 2007
    #4
    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
     
  4. Makosuke macrumors 603

    Joined:
    Aug 15, 2001
    Location:
    The Cool Part of CA, USA
    #5
    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.
     
  5. jbushne1 macrumors newbie

    Joined:
    Aug 27, 2011
  6. hayesk macrumors 65816

    Joined:
    May 20, 2003
    #7
    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.
     

Share This Page