|
|
How do I save HTML files from TextEdit?I am new to the Mac world and I have started with Tiger. When I use the textedit program to type HTML code and save it as an HTML document all I see is the code when I open the file in any of the browsers that I use. Unlike Notepad in Window, why can't I see the results of my code in a web page? I am completely lost and have combed the Internet. The simple Text Editor program in the older versions of the Mac OSs' seemed to work just like Notepad in Windows. Please let me know what I am doing wrong. Just as with NotePpad on the PC, there's a bit of a trick to getting TextEdit to save HTML files properly, and it's all to do with the filename extension. Yes, we're now deep into the 21st Century, but computer operating systems still basically work like early DOS machines: If you have the wrong filename extension, either your OS itself won't understand it or your Web browser will be convinced that even though it looks like HTML inside it's really just plain text to show as-is. Sheesh. In TextEdit, you'll type in some HTML and have a window that looks like this: ![]() This is not good because the program wants to work with Rich Text Format, not plain text (the ruler is the giveaway). To fix that, go to Format --> Make Plain Text and, voila! It'll look like this: ![]() Much better! Now, almost done (and you only have to go through this once: once the file is properly named, TextEdit will remember for future edit sessions). Choose File --> Save As... and type in a filename that includes a ".html" filename extension: ![]() Looks good. Click on "OK", though, and now you get this: ![]() Click on "Use .html" and, finally, you're done! Yes, it's a bit of a pain, but, as I said, you only have to do this once, when you first save the file, and from then on, it'll work transparently.
More Useful Mac OS X Help Articles:
✔ Audacity can't find LAME library, I can't save Mp3?
Hey Dave. I read your article Audacity can't save mp3 audio files and am still puzzled because I downloaded the LAME Mp3 converter...
✔ How to remove Dashboard as a "space" in Mac OS X Spaces?I'm a big fan of the Spaces utility in Mac OS X that lets me have multiple virtual screens [see Set Up Mac...
✔ Best place to buy a cheap MacBook laptop?Hi Dave. I am looking for two gently used MacBook laptops for my teen daughters. Personal computers would greatly facilitate their studies as...
✔ File too big error copying to USB flash drive on my Mac?I'm baffled. I have a 16GB Kingston USB flash drive that I use on my Mac system and I'm trying to copy a...
✔ Stealth image capture photo from webcam on my Mac?Someone sneaks into my cubicle while I'm at lunch and takes candy out of my desk. Petty, but stupid too. I want to...
Let's stay in touch!
Sign up for my weekly AskDaveTaylor Newsletter and you'll receive even more tech and gadget help
right to your inbox, along with exclusive news and industry updates. It's good stuff. I promise!
Categorized:
Mac OS X Help
(Article 4097,
Written by Dave Taylor)
Tagged: Previous: Sarbanes-Oxley affects small businesses too? Next: How do I set my default email program on Mac OS X? Reader Comments To Date: 48Michael Billips said, on February 19, 2007 2:50 PM:
This method only works the first time you save the file. After that, it will be .html/.htm but when you reopen it TextEdit will kindly help you hide all your source code as rich text formatting and display only the outcome. To prevent this, open Preferences, go to the Open and Save tab, and check "Ignore rich text commands in HTML files". (This is on OS X Tiger) niloy said, on April 27, 2007 3:18 AM:
hi........ Shaun said, on February 17, 2008 9:24 AM:
THANKS A LOT NOW I CAN SAVE IT !!!!!!!!!! josh casbolt said, on June 4, 2008 10:11 AM:
hi thank you so much you helped me with making html with textedit ;) thanks a lot b said, on June 13, 2008 7:33 AM:
oh my god, thank you so much. i can finally turn in my homework. Lil said, on October 1, 2008 11:10 AM:
WOW!! This is EXACTLY what i was looking for!! I'm actually very surprised i was able to find my solution online. (i thought i was a dolt because i didn't think it would be any different on a mac than on Windows.. and that i was doing something wrong) thanks SO much for posting this question and answer! MaeGal said, on January 10, 2009 5:18 PM:
Thank you so much! I have having this exact same problem. You have made me so very happy just now. :D Thanks! UUsfg said, on January 27, 2009 11:22 PM:
THANKS!!! Finally!!! michael Hines said, on February 7, 2009 1:22 PM:
no, this still doesn't work. i've changed all the preferences and resaved and each time i reopen the file, it comes up as a page with no coding as though it were html instead of plain text. i use os X. Anne said, on February 8, 2009 4:42 PM:
I can't get it to work either. I followed your directions above and saved as with .html extension. Looks OK in my browser (except for quotes and dashes come out as code - why is that?), but if I open the .html file in textedit to do some editing no code comes up. It look like the web page. Anne said, on February 9, 2009 9:32 AM:
Actually it doesn work after I changed my preferences. But how do I get apostrophes and quotes to display properly in HTML? Lauren said, on February 26, 2009 9:37 AM:
Thank you - Thank you - Thank you!!! haleshk said, on March 2, 2009 2:18 AM:
Thank you. you solved my proble simple way Nathan said, on April 2, 2009 7:20 PM:
Thank you so much! I am a former windows user, and this issue was giving me a headache. Greatly appreciated! Mee said, on April 4, 2009 2:01 AM:
Hi Dave, I downloaded a file which is not a pdf(my all time favorite). Only problem is I cannot save it to my HD. Thanks yu Chen said, on May 31, 2009 9:42 AM:
hi. you know what. i am able to save it now and view it on my browser, but when i open up the file with textedit, all the codes are now gone....... what is up with that? thomas said, on June 21, 2009 3:50 AM:
Thank you so much desmond said, on September 9, 2009 9:00 PM:
thx a million !!! very helpful ! John said, on September 17, 2009 5:31 AM:
Thanks - you have just saved me so much money on Aspirin! Why do they do makes things so complicated? I appreciate your efforts. Bela Butalia said, on January 18, 2010 8:16 AM:
Dear Dave (if I may call you that), Jerry said, on February 24, 2010 1:44 PM:
This is sound advice ... but I'm finding that my HTML shows up in the browser with a strange character -- Ê -- in place of many of the spaces (and not just in text content, but all over the HTML, which pretty much destroys the tags and formatting). ;-) I cut-and-pasted the text from TextEdit to MS Word, saved that as a text file (with .html extension), and the page rendered as intended. It appears that TextEdit is inserting these "spurious" characters into the text file in place of (some of the) spaces. Are you familiar with this? Thanks for all your help! (Using TextEdit 1.4 under Tiger 10.4.11) Jerry said, on February 24, 2010 1:51 PM:
Should have included this above, but .... Might the character set in this tag have something to do with the matter? Jerry Gloekler said, on February 24, 2010 1:53 PM:
Darn it ... [left-angle-bracket] meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" / [right-angle-bracket] Dave Taylor said, on February 24, 2010 2:59 PM:
You nailed it, Jerry. Go to Preferences and look at the Open & Save tab. You'll see encoding preferences. I set mine to Unicode (UTF-8) and don't have that problem. I'll write a blog post about it soon. :-) custom tailor said, on February 27, 2010 4:25 AM:
is there any way that i can save an html files with its value also.So that when i open that file again it comes in the same value that i had saved. Jerry said, on March 1, 2010 12:32 PM:
Thanks, Dave. Actually, I _did_ have the "Encoding" preference set to UTF-8 ... but I noticed that I had the "Document Type" set to "HTML 4.0.1 Strict" when the pages I've been working on are of type "XHTML 1.0 Transitional". (So even though I don't see how THAT setting explains the issue, I changed it.) I was hoping to report that this fixed everything, but decided to test before posting. (Imagine that!) Unfortunately, something's still wrong. Somehow it seems the HTML text files get corrupted and get stored on the hosting site with these "Ê" characters (including "& Ecirc;" or hex 0xCB) and other trash (e.g."¬"/& not;/0xAC or "Â"/& Acirc;/0xC2), like this:
!DOCTYPEÊhtmlÊPUBLICÊ"-//W3C//DTDÊXHTMLÊ1.0ÊTransitional//EN"Ê"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> [right-angle-bracket]
Thanks again, and if I learn anything more, I'll post it. John Moreno said, on May 5, 2010 9:19 PM:
While you can make TextEdit work, it'd be better to use something like TextWrangler instead. TextEdit isn't primarily a plain text editor. tama said, on June 20, 2010 9:41 AM:
great! it worked Priyanka Kannan said, on October 4, 2010 11:17 AM:
THANK YOU SOOO MUCH!! I was so frustrated.. anyways this was really helpful :) Kaleigh said, on October 30, 2010 1:48 PM:
Hello, Dolores said, on November 8, 2010 10:52 AM:
Hello, I read your advice and it fixed my problem! Now I have some question which no one has been really able to help me... I am a graphic designer but not a website Developer. I want to learn from scratch (without using templates) how to make a website work Exactly the way I want it.. Any clues how I can learn all these? Mackenzi said, on December 7, 2010 2:59 PM:
Thank you so much! Been looking for this answer forever! Annie said, on December 8, 2010 8:51 PM:
I don't know how to thank you enough -I spent the whole day reading 1000+ blogs and opened more than 10 books and nothing helped until I found you! Matthew Loonam said, on February 5, 2011 9:10 PM:
Thanks for this! It was driving me crazy! Marco said, on February 25, 2011 10:00 AM:
hello dave i found this very useful for a question i posted a few minutes ago so you dont need to answer anymore, lol thanks a lot, great site!!!! CS said, on March 3, 2011 11:04 AM:
Here's another very grateful person! Thanks for posting this very basic but CRUCIAL information. TYTYTY D. said, on March 3, 2011 8:30 PM:
In textedit I took your hints and got the page to load and look like a web page, but I am unable to reopen the file the next day and work on the html codes. It only opens up the displayed web page version. How do I get it to go back to html code in textedit without cutting and pasting? Chris Baird said, on July 16, 2011 3:29 AM:
Excellent! Many thanks Stuart said, on July 28, 2011 5:25 AM:
Hi, I have just started to learn the basics of HTML coding and have twice visited your helpful pages and you have clearly and helpfully solved both of my problems. Just wanted to say a big thanks ! CHELLE said, on August 31, 2011 11:32 PM:
Good Day! Please help me how to save my HTML works that can be edited. I'm using Microsoft FrontPage. Thanks! et said, on December 10, 2011 9:05 PM:
Thank God you are here!!! :() Oan said, on January 6, 2012 8:05 AM:
Thank you - Thank you! You have made the process of making websites at home for everyone very smooth and cool. Richard said, on April 14, 2012 2:55 PM:
Thank you - this was really bugging me! Baz said, on April 22, 2012 7:04 AM:
Cheers. I appreciate your skill Ryan said, on June 24, 2012 4:23 PM:
You're awesome man!! Thank you so much for your posting. I swear I spent 2 hours with the same issue and was about to throw my computer against the wall, mostly kidding there, but your posting cleared it up no problem. I am new to programming and all of this can be very frustrating to learn at times since it's completely new to me, but you helped a lot, so thanks! Subaco said, on October 3, 2012 1:20 PM:
thanks a lot! sundari said, on November 6, 2012 1:46 AM:
Very Nice
I do have a comment, now that you mention it!Check This Out Too... |
Recent Entries
Look for Answers
Recommended
All Our Categories
Apple iPad Help
Articles and Reviews Auctions and Online Shopping Blogs and Blogging Building Web Site Traffic Business and Management Computer and Internet Basics d) None of the Above Facebook Help Google Gmail Help Google Plus Help HTML, JavaScript and Web Site Programming Industry News and Trade Shows iPhone and Cell Phone Help iPod, Sony PSP and MP3 Player Help Kindle Fire Help Mac OS X Help Pay Per Click (PPC) Advertising Pinterest Help Search Engine Optimization (SEO) Shell Script Programming Tech Support Video Help The Writing Business Twitter, LinkedIn and Social Network Help Unix and Linux Help Video Game Tips and Help Windows PC Help Find Me on Google+ ADT on G+ |
A more permanent fix would be to enter TextEdit's Preferences. Inside the "Saving" area (near the bottom-right) there's an option that's checked by default, which you'd probably want to toggle:
� Append ''.txt'' extension to plain text files
Uncheck that, and you shouldn't have this problem anymore.