Results 1 to 7 of 7
  1. #1


    Member Since
    Nov 01, 2009
    Posts
    4
    Opening Local HTML files - render HTML (not display as text)
    Hello everyone,

    I am somewhat new with web development on a mac, and am running into some issues trying to test my HTML. I create an HTML file and save it to my local file system. When I open it in a web browser (Firefox and Safari), the page displays the literal HTML text instead of rendering the HTML into a web page like it should.

    Is there a setting somewhere on the Mac OS that can overturn this?

    Thanks.

  2. #2

    vansmith's Avatar
    Member Since
    Oct 19, 2008
    Location
    Toronto
    Posts
    19,788
    Specs:
    Early 2015 13" rMBP
    You should have no problem with opening html files in your web browser. Are you saving them with the html extension (.html or .htm)?
    Important Links: Community Guidelines : Use the reputation system if you've been helped.
    M-F Blog :: Write for the blog
    Writing a Quality Post

  3. #3


    Member Since
    Nov 01, 2009
    Posts
    4
    Thanks for the quick reply
    Thank you for the quick response.

    Yes, the file had a .html extension. The file info displays as "HTML Document". However, even the preview just displays the literal HTML text. Very frustrating, considering this is such a trivial issue on a PC. Is there a setting in the Apache Web Server on OS X that is running a style transform on local HTML documents to cause the literal text to be displayed?

    Another thing to add: when I view the page source, it appears additional HTML has been added so that the page will display the literal HTML. Makes zero sense.

    Pardon my frustrations.

  4. #4

    Dysfunction's Avatar
    Member Since
    Mar 17, 2008
    Location
    Tucson, AZ
    Posts
    6,881
    Specs:
    Way... way too many specs to list.
    I don't believe the Preview application does HTML rendering. Now, why the browsers are not rendering html? I've no idea... generally when I've seen that it was a code issue...


    edit: are you browsing this through the filesystem or through the webserver?
    mike
    This machine kills fascists
    Got # ? phear the command line!

  5. #5


    Member Since
    Nov 01, 2009
    Posts
    4
    Quote Originally Posted by Dysfunction View Post
    I don't believe the Preview application does HTML rendering. Now, why the browsers are not rendering html? I've no idea... generally when I've seen that it was a code issue
    I tried it with a very basic HTML file
    <html>
    <head />
    <body>abcd</body>
    </html>

    And it does the exact same thing (displays tags & text as a literal text file). Make little sense to me as well, and I doubt it is browser specific since Safari and Firefox are both doing it. Almost tempted to chalk up the loss and scrap the mac from a web development standpoint, because this is way too trivial to be spending a lot of time trying to troubleshoot.

  6. #6

    Dysfunction's Avatar
    Member Since
    Mar 17, 2008
    Location
    Tucson, AZ
    Posts
    6,881
    Specs:
    Way... way too many specs to list.
    I just copied that into textedit and saved it as html... it did the same as you described... so I did a cat -v

    Code:
    mikeMbp:Desktop mike$ cat -v Untitled.html 
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <html>
    <head>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      <meta http-equiv="Content-Style-Type" content="text/css">
      <title></title>
      <meta name="Author" content="Mike">
      <meta name="Copyright" content="Mike">
      <meta name="Generator" content="Cocoa HTML Writer">
      <meta name="CocoaVersion" content="1038.11">
      <style type="text/css">
        p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Times}
      </style>
    </head>
    <body>
    <p class="p1">&lt;html&gt;</p>
    <p class="p1">&lt;head /&gt;</p>
    <p class="p1">&lt;body&gt;abcd&lt;/body&gt;</p>
    <p class="p1">&lt;/html&gt;</p>
    </body>
    </html>
    mikeMbp:
    So i edited out the cr@p in vi.

    Code:
    mikeMbp:Desktop mike$ cat -v Untitled.html 
    
    <html>
    <head>
    <title></title>
    </head>
    <body>
    abcd
    </body>
    </html>
    and it works. It's not the mac, it's textedit (which I think sucks anyway) try textwrangler, it's LEAPS and BOUNDS better as an editor.

    Alternately you can (in textedit) go to Format > Make Plain Text


    I hate rich text biased editors.
    mike
    This machine kills fascists
    Got # ? phear the command line!

  7. #7


    Member Since
    Nov 01, 2009
    Posts
    4
    Thanks for the suggestion! You are right -- it probably is the text editor. I have been using komodo edit, but haven't really found it very intuitive. I will take a look at text wrangler.

    Thanks again!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 0
    Last Post: 08-22-2011, 10:18 AM
  2. Opening html
    By Leonardo in forum Web Design and Hosting
    Replies: 8
    Last Post: 05-25-2009, 04:21 PM
  3. Inserting Images from Local hard drive into html in PHP Site
    By samanthad in forum Web Design and Hosting
    Replies: 1
    Last Post: 09-25-2008, 03:49 AM
  4. Opening an HTML file as an editable text file
    By newmacmike in forum Web Design and Hosting
    Replies: 6
    Last Post: 04-10-2007, 12:43 AM
  5. Change text in 60 html files
    By timswim78 in forum Running Windows (or anything else) on your Mac
    Replies: 2
    Last Post: 05-03-2006, 06:11 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •