Results 1 to 9 of 9
  1. #1


    Member Since
    Nov 30, 2008
    Posts
    4
    Saving from Textedit as .html
    Well,

    On Windows I can write html code in Notepad and save it as .html, open it with a browser and I see the page as the html dictates I should.

    On this Mac I've gotten recently I've tried writing html in Textedit and saving it as an html file, and opening it with a browser - and I see only what I wrote, meaning the code itself. For example, in a file I had <body bgcolor="yellow"> and instead of the background being yellow I saw "<body bgcolor="yellow">" on the page when I opened the browser.

    How could I be able to simply write simple html code in a word processing program like Textedit and, when I open it locally, have the browser actually recognize the code and execute it?

    Thanks,
    Oijl

  2. #2

    wheelguy's Avatar
    Member Since
    Jun 18, 2006
    Location
    Minneapolis
    Posts
    191
    Specs:
    MacBook Pro
    When you save the file use "save as" and choose html from the dropdown.
    If you aren't fired with enthusiasm, you will be fired with enthusiasm. -Vince Lombardi

  3. #3


    Member Since
    Nov 30, 2008
    Posts
    4
    That's what I did, I mean. And when I open that html file, it opens with a browser, but I just see the code itself.

  4. #4

    CrimsonRequiem's Avatar
    Member Since
    Jul 24, 2008
    Posts
    6,004
    Specs:
    MBP 2.3 Ghz 4GB RAM 860 GB SSD, iMac 3.4 GHz Intel Core i7 32GB RAM, Fusion Drive 1TB
    Under preferences what are your settings?

  5. #5


    Member Since
    Nov 30, 2008
    Posts
    4
    Ah. Is that what it is?

    My settings for Textedit are, for html saving, no css, html 4.0.1 strict, UTF-8 encoding.

    Should they be something else?

  6. #6

    CrimsonRequiem's Avatar
    Member Since
    Jul 24, 2008
    Posts
    6,004
    Specs:
    MBP 2.3 Ghz 4GB RAM 860 GB SSD, iMac 3.4 GHz Intel Core i7 32GB RAM, Fusion Drive 1TB
    Well I just experimented with the text edit and it seems to do some pretty weird stuff.

    First off your preferences are fine.

    What I found was that when I did File->Save As... and then changed it to html and I open the file, I see the code.

    However when I leave the file format at rich text or whatever and just add .html to the end of the file name it works.

  7. #7


    Member Since
    Nov 30, 2008
    Posts
    4
    Mmm, thanks! That works, it does what it should, but there's also this long string of text that shouldn't be there.

    Specifically, to test if this would work I made a file that contains:

    <html>
    <body bgcolor="orange">
    </body>
    </html>

    and when I save it as .rtf and then change the file to .html, and open it with a browser, the background is orange, but I can see the text:

    {\rtf1\ansi\ansicpg1252\cocoartf949\cocoasubrtf350 {\fonttbl\f0\fswiss\fcharset0 Helvetica;} {\colortbl;\red255\green255\blue255;} \margl1440\margr1440\vieww9000\viewh8400\viewkind0 \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5 040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural \pardirnatural \f0\fs24 \cf0 \ \ \ }

    as well.

    How should I solve this problem, do you think?

  8. #8


    Member Since
    Sep 23, 2006
    Posts
    246
    Honestly I have had this problem before and to fix it i just got the program SMULTRON. It is a text editor taht also allows HTML, Scripting etc.

    Tuppis - Smultron by Peter Borg

    I like it so far, and it allows for a variety of coing helps like numbered lines etc.

  9. #9


    Member Since
    Nov 16, 2008
    Posts
    47
    You should be able to save by just doing (filename).html

    Or another alternative is textWrangler.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Trouble Editing HTML Document With TextEdit
    By YourAdrenaline in forum OS X - Operating System
    Replies: 2
    Last Post: 07-11-2013, 03:25 PM
  2. html problem - TextEdit
    By hello1000 in forum OS X - Apps and Games
    Replies: 1
    Last Post: 02-24-2013, 03:31 AM
  3. Creating simple HTML files in Mac OS X with TextEdit...
    By AxiomOfChoice in forum OS X - Apps and Games
    Replies: 12
    Last Post: 04-02-2012, 06:18 PM
  4. Saving TextEdit
    By VegasGeorge in forum Switcher Hangout
    Replies: 3
    Last Post: 12-26-2009, 07:28 PM
  5. Replies: 5
    Last Post: 09-16-2009, 09:30 AM

Posting Permissions

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