Help - Search - Members - Calendar
Full Version: Site only displays plain text
HTMLHelp Forums > Web Authoring > General Web Design
DrMummy
I'm not sure what I did wrong. The website I'm building is only displaying raw plain text html.

Here's the site.

Could somebody help me out with this one?
Brian Chandler
Look at the file: it starts with

CODE

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <meta http-equiv="Content-Style-Type" content="text/css">
  <title></title>
  <meta name="Generator" content="Cocoa HTML Writer">


So this "Cocoa" thing is converting what you have written into a web page which displays what you have written. Simply copy the text from the displayed web page, and save it as a file mywebpage.html. Then view this file in a browser.
pandy
No, it isn't. View Source. There's a whole other HTML document behind it, constructed to show off your original markup like that. It's basically doing this, only a little more fancy.
http://htmlhelp.com/faq/html/basics.html#show-html

Are you on a Mac? We've had two other guys with the same problem recently. Both were on Mac. I'm not, so maybe I don't use the right terms here, but instead of doing a normal Save, you have clicked on something that makes the program you use create what you see.

There are some Mac guys here, so please tell us what editor you use and maybe they can tell you what menu command to use.
DrMummy
I am using a mac.

If somebody knows exactly what I need to do, that would be a help.

I used texteditor, and I saved it as an html file.
Frederiek
http://www.macosxhints.com/article.php?sto...060828093624972
I don't know if it will help much, though. I just did a quick try in TextEdit, but to no avail.

Anyway, you'd better not use TextEdit, but get the free TextWrangler from http://www.bbedit.com/.
Darin McGrew
QUOTE
I used texteditor, and I saved it as an html file.
Right. So the application created an HTML document that showed exactly what you typed. It doesn't matter that what you typed looks like HTML source.

You need to save it as plain text, so the application saves exactly what you typed.
pandy
Don't Mac editors have a simple Save command as Windows and Linux editors do? I'm curious why this is such a common (well) issue.
Frederiek
Sure.
Sorry, but it comes down to knowing how to use your computer (+ OS) and its apps.
pandy
So what's File | Save and Ctrl + S in Macineese?
Darin McGrew
On MacOS, the standard save is File | Save from the menu, and Command-S from the keyboard. But I thought the OP had used File | Save As... or Shift-Command-S and chosen HTML, so the app obliged and converted the markup into an HTML document that displayed the markup, rather than using the markup "as is".

I'm not sure what app would do that though. The standard TextEdit doesn't.
Tom H.
In its default configuration, TextEdit behaves just as Darin describes. It acts as lightweight word processing application, similar to WordPad on Windows. It can also act as a plain text editor; such behavior can be switched on a document-by-document basis or through the application preferences.
pandy
Thanks. Now I know next time someone has this problem. So File |Save is the same as on Windows and it's Save As that can be risky.
Darin McGrew
Ah, thanks. I always use TextEdit in the "Plain Text" mode. I had forgotten about the "Rich Text" mode. (I use OpenOffice if I'm going to use anything more than plain text.)

And yes, you can Save As HTML in "Rich Text" mode and it will create an HTML document that displays whatever rich text you typed.
Julia
You can use TextEdit, just follow these rules.

Go into textedit preferences. Then click on PLAIN TEXT under New Document. Under Open and Save check XHTML 1.0 Strict and No CSS under styling. The encoding should be unicode (UTF-8).

Then save your document. You can either do this as save or save as. Title your document as 'index.html'. Make sure that unicode (UTF-8) is selected under Plain Text Encoding toward the bottom of the save screen. Then hit save. Go into your browser and open your file. It should work.

If unicode (UTF-8) is not an option on your save window, open a new textedit window and copy and paste your file into the new window and save.
pandy
And they say Mac is easier... happy.gif

From what I hear TextEdit isn't all that hot anyway. You could try TextWrangler (free) if you want. I would, had I a Mac.
http://www.barebones.com/products/TextWrangler/
Frederiek
TextEdit is great to open .doc files without having to open the MS monster. It leaves out all the Word fuzz, but I can read or copy the text, which is mostly all I want. Occasionally I use OpenOffice.
rcanpolat
i second that - fred told me about textwrangler - its a great little tool! its so much better then mac's text edit.

your a brave man writing a .html in mac's textedit
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.