New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus • Advice and insight from world-class Apple enthusiasts • Exclusive access to members-only contests, giveaways and deals

Join today!

 
Start a Discussion
 

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
Web Design and Hosting Creating sites, scripting, and hosting discussions.

Saving from Textedit as .html


Post Reply New Thread Subscribe

 
Thread Tools
Oijl

 
Member Since: Nov 30, 2008
Posts: 4
Oijl is on a distinguished road

Oijl is offline
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
QUOTE Thanks
wheelguy

 
wheelguy's Avatar
 
Member Since: Jun 18, 2006
Location: Minneapolis
Posts: 191
wheelguy will become famous soon enough
Mac Specs: MacBook Pro

wheelguy is offline
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
QUOTE Thanks
Oijl

 
Member Since: Nov 30, 2008
Posts: 4
Oijl is on a distinguished road

Oijl is offline
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.
QUOTE Thanks
CrimsonRequiem

 
CrimsonRequiem's Avatar
 
Member Since: Jul 24, 2008
Posts: 6,006
CrimsonRequiem is a name known to allCrimsonRequiem is a name known to allCrimsonRequiem is a name known to allCrimsonRequiem is a name known to allCrimsonRequiem is a name known to allCrimsonRequiem is a name known to allCrimsonRequiem is a name known to all
Mac Specs: MBP 2.3 Ghz 4GB RAM 860 GB SSD, iMac 3.4 GHz Intel Core i7 32GB RAM, Fusion Drive 1TB

CrimsonRequiem is offline
Under preferences what are your settings?
QUOTE Thanks
Oijl

 
Member Since: Nov 30, 2008
Posts: 4
Oijl is on a distinguished road

Oijl is offline
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?
QUOTE Thanks
CrimsonRequiem

 
CrimsonRequiem's Avatar
 
Member Since: Jul 24, 2008
Posts: 6,006
CrimsonRequiem is a name known to allCrimsonRequiem is a name known to allCrimsonRequiem is a name known to allCrimsonRequiem is a name known to allCrimsonRequiem is a name known to allCrimsonRequiem is a name known to allCrimsonRequiem is a name known to all
Mac Specs: MBP 2.3 Ghz 4GB RAM 860 GB SSD, iMac 3.4 GHz Intel Core i7 32GB RAM, Fusion Drive 1TB

CrimsonRequiem is offline
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.
QUOTE Thanks
Oijl

 
Member Since: Nov 30, 2008
Posts: 4
Oijl is on a distinguished road

Oijl is offline
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?
QUOTE Thanks
Qua Sar

 
Member Since: Sep 23, 2006
Posts: 246
Qua Sar is on a distinguished road

Qua Sar is offline
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.
QUOTE Thanks
dchen510

 
Member Since: Nov 16, 2008
Posts: 47
dchen510 is an unknown at this point

dchen510 is offline
You should be able to save by just doing (filename).html

Or another alternative is textWrangler.
QUOTE Thanks

Post Reply New Thread Subscribe


« How to post web-sites | Help »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread
Thread Starter
Forum
Replies
Last Post
Saving your beer money rob.h Switcher Hangout 2 03-26-2008 09:44 AM
help! im loosing all my notes! files not saving properly fivemagics77 OS X - Apps and Games 0 09-21-2007 02:38 PM
I did not know TextEdit could do that! (Or, 'Take THAT Wordpad.exe!') walkerj Switcher Hangout 4 07-04-2007 05:31 PM
Saving TextEdit files to sub-folder. How? Steve1 OS X - Apps and Games 2 08-28-2006 12:51 PM
Opera > View Source > TextEdit herkalees OS X - Apps and Games 3 02-16-2006 08:48 AM

All times are GMT -4. The time now is 02:30 PM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
X

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?