Can't preview html in browser

Discussion in 'Mac Basics and Help' started by Eleven11punk, Jul 23, 2010.

  1. Eleven11punk macrumors newbie

    Joined:
    Jul 23, 2010
    #1
    So I typed up some simple html code in text edit and saved it as an html file. However, when I preview it in firefox or safari it only shows the code. I even tried saving the code in word as an html file and it does the same thing.
    This is my code...very simple:
    <html>
    <body>
    <h1> Carly Krysak</h1>
    <p>Marketing Director</p>
    <h2>Frank's Auto Supermarket</h2>
    <p>P: 724.430.2000</p>
    <p>F: 724.438.5990</p>

    <a href="http://tiny.cc/FbWeSpeakCar">Facebook</a>
    <a href="www.autosupermarket.com">Website</a>
    <a href="www.GrindingGearsBlog.com">Blog</a>

    </body>
    </html>


    I'd like to use this code to create a custom signature for my email so I thought maybe it's just having a problem previewing and I followed the steps to use the code for my signature and it also just shows the html.
     
  2. SpookyLars macrumors 6502

    Joined:
    Jul 21, 2008
    Location:
    Poland
    #2
    Are you sure the file has html extension? I saved your code in html file and it shows in browser without problems.
     
  3. Eleven11punk thread starter macrumors newbie

    Joined:
    Jul 23, 2010
    #3
    yep. I cntrl clicked on "Get info" and listed under "name & extension" is "fra.html" The box to "hide extension" is also unselected and it is set to open with safari as default....although I've also tried to open it with firefox and it does the same thing. I copied my code into a test generator online and it displayed correctly, but for some reason it doesn't work in any application on my mac.
     
  4. SpookyLars macrumors 6502

    Joined:
    Jul 21, 2008
    Location:
    Poland
    #4
    Maybe this is source of the problem. Try plain text editor like TextEdit.
     
  5. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #5
    Was TextEdit in plain text mode or rich text mode (was there a toolbar letting you set the font etc). If it was in rich text mode then it is saved as rtf regardless of the extension you chose: you need to switch to plain text mode.
     
  6. panoz7 macrumors 6502a

    panoz7

    Joined:
    Nov 21, 2005
    Location:
    Raleigh, NC
    #6
    I haven't used textedit to edit html in a long time, so I may be wrong, but I'm pretty sure it saves as rich text by default. If you want to continue using textedit you need to go into the settings and change it to plain text.

    That said, I would recommend avoiding textedit entirely -- there are far better choices for editing code. Textwrangler is a free somewhat limited version of bbedit. If you're new to coding then it will likely be able to do everything you need. Personally I use textmate which costs money but IMO is worth it.
     
  7. Eleven11punk thread starter macrumors newbie

    Joined:
    Jul 23, 2010
    #7
    I tried that first before I tried Word.
     
  8. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #8
    See above: by default TextEdit is not a plain text editor.
     
  9. Eleven11punk thread starter macrumors newbie

    Joined:
    Jul 23, 2010
    #9
    That fixed it! I didn't know you had to change to plan text in the options..okay..well thank you all so much! :D
     

Share This Page