Jump to content
opening html documents
Asked by Jakobhill
Posted Apr 17 2011 05:44 AM
I´m just getting started with "Creating a web site" which so far seems perfect for a beginner like myself.
I just made the "skeleton" for my own xhtml document according to chapter 2 and wanted to see how it looked in my browser (safari). The problem is that when I double click on the html document, (which I have saved as an html file), Safari seems to open the exact same text as written in Text Edit. It shows the entire text as displayed in TextEdit. I tried to validate the html document with Markup Validation service and it checked out.
I hope someone has an easy solution to my problem, as you can tell I´m a beginner at thios..
Comment by macnlos : Apr 18 2011 10:49 AM
Can you post the HTML code? Or better yet can you add the the file as an attachment here?
Sent to you from my
iPad, iPhone, BlackBerry,
Laptop, Desktop, or
Answered by rachel.j
Posted Apr 19 2011 06:28 AM
It sounds like TextEdit isn't saving the file as a plain text html document (I believe TextEdit saves files as rich text by default). Here's what I think you'll need to do to:
Here's a blog post that explains some of this.
Once you've created/edited a file with these settings, you should be able to open it in your browser and have it interpreted correctly.
This is a common problem, because a lot of text editors have default settings that aren't what you need for writing code. The book's editor is planning to add a note about this to future editions of the book.
Comment by rachel.j : Apr 28 2011 08:39 AM
Good point, Dave. I also use TextWrangler for development on a Mac. It's a good text editor, and it has tools like code coloring that are very useful for developers. And it's free!