Can't preview html in browser

Eleven11punk

macrumors newbie
Original poster
Jul 23, 2010
4
0
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.
 

SpookyLars

macrumors 6502
Jul 21, 2008
348
0
Poland
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.
Are you sure the file has html extension? I saved your code in html file and it shows in browser without problems.
 

Eleven11punk

macrumors newbie
Original poster
Jul 23, 2010
4
0
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.
 

robbieduncan

Moderator emeritus
Jul 24, 2002
24,638
61
Harrogate
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.
 

panoz7

macrumors 6502a
Nov 21, 2005
904
1
Raleigh, NC
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.
 

Eleven11punk

macrumors newbie
Original poster
Jul 23, 2010
4
0
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