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.

previewing web pages in Safari


Post Reply New Thread Subscribe

 
Thread Tools
paperclip

 
Member Since: Jun 28, 2008
Posts: 5
paperclip is on a distinguished road

paperclip is offline
I am a beginner and I just bought a html book to get started. (Elizaeth Castro, 'visual quickstart guide' 6.ed). I have created a web page using TextEdit and have saved the file as .html. When I open the file in Safari the page will not display as a web page but only shows me the html code. I'm hoping to build upon this modest start but am stuck already.
Here's what I've got so far.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
> <html xmlns="http://www.w3.org/1999/xhtml">
>
> <head>
> <meta-equiv="content-type" content="text/html; charset=utf-8"/>
> <title>
> My Title
> </title>
> </head>
>
> <body>
> <h1>Interests</h1>
> <p>Likes to play guitar and sing.</p>
> <h2>Favorite Guitar</h2>
> <p>My favorite guitar is an early seventies Les Paul.</p>
> </body>
> </html>

Thanks for any help,

Paperclip
QUOTE Thanks
louishen

 
louishen's Avatar
 
Member Since: Oct 22, 2007
Location: London
Posts: 8,945
louishen has a brilliant futurelouishen has a brilliant futurelouishen has a brilliant futurelouishen has a brilliant futurelouishen has a brilliant futurelouishen has a brilliant futurelouishen has a brilliant futurelouishen has a brilliant futurelouishen has a brilliant futurelouishen has a brilliant futurelouishen has a brilliant future
Mac Specs: Mac Mini Core i7 2012 | White 2009 MacBook 2 Ghz | 733 Mhz G4 Quicksilver

louishen is offline
It works fine if you take all those > from the beginnings of each line
QUOTE Thanks
skaheadpunk

 
skaheadpunk's Avatar
 
Member Since: Jan 12, 2008
Location: Leicester, England
Posts: 1,760
skaheadpunk has a spectacular aura about
Mac Specs: MacBook, iPod Classic, 8GB 3G iPhone, Time Capsule

skaheadpunk is offline
I think I had to save as .htm to make it display properly...
QUOTE Thanks
paperclip

 
Member Since: Jun 28, 2008
Posts: 5
paperclip is on a distinguished road

paperclip is offline
Thanks Louishen and Skaheadpunk for your response. I feel encouraged that the code works on your browsers. I removed the > from the beginning of each line but it still does not work. (Those > signs must have got put there by TextEdit when I copied and pasted the file as I did not put them when I wrote the html.) TextEdit will not let me save the file as htm - only html.
I'm open to suggestions.

Paperclip
QUOTE Thanks
skaheadpunk

 
skaheadpunk's Avatar
 
Member Since: Jan 12, 2008
Location: Leicester, England
Posts: 1,760
skaheadpunk has a spectacular aura about
Mac Specs: MacBook, iPod Classic, 8GB 3G iPhone, Time Capsule

skaheadpunk is offline
When you go to save as and type the filename, whack .htm on the end, then it asks you which extension you want to use, stick with .htm. Works for me!
QUOTE Thanks
paperclip

 
Member Since: Jun 28, 2008
Posts: 5
paperclip is on a distinguished road

paperclip is offline
Thanks for your help Skaheadpunk. TextEdit does not want me to save the file with an htm extension. I get an error window that only allows html or the use of both htm and html like this .htm.html. I saved the file with both extensions and then removed the html at the end. Safari still won't display the page as a web page.
I then saved the file in MS word 2004, with the file extension htm. I used both the 'save as' and 'save as a web page' options and tried both. Safari will not dispay the file as a web page. I'm really stumped.


Paperclip
QUOTE Thanks
moethejoey

 
moethejoey's Avatar
 
Member Since: Jul 22, 2008
Location: Brecon, Wales
Posts: 8
moethejoey is on a distinguished road

moethejoey is offline
Hi Paperclip
I had the same problem. This is what solved it:
Go into Textedit preferences
Select 'Plain text' in the Format section.
Close and restart Textedit
Copy and paste your original text into a new document in textedit
Select save as and put filename.html into the top box
in the dialogue box accept .html as the extension

the file then displayed correctly in Safari for me when i opened it. hope this helps
Moe
QUOTE Thanks
ki99

 
ki99's Avatar
 
Member Since: May 31, 2007
Location: Ontario, Canada.
Posts: 926
ki99 is a jewel in the roughki99 is a jewel in the roughki99 is a jewel in the rough
Mac Specs: Macbook(W) 2GHz, 80GB HD, 1G RAM, Windows XP

ki99 is offline
follow the above post. when textedit is in richtext mode is has a neat feature (that always tends to trip up people learning to code html in it) but you can create a normal document, and save it as html to view on the web without having to write your own code. but as stated above, if you change it to plain text, you should find yourself having no problems.
QUOTE Thanks
moethejoey

 
moethejoey's Avatar
 
Member Since: Jul 22, 2008
Location: Brecon, Wales
Posts: 8
moethejoey is on a distinguished road

moethejoey is offline
yes further to all two previous posts, if you go to the 'Open and Save' tab under TextEdit preferences and check the 'Ignore rich text commands in html files' as well, the page should load correctly in a web browser but appear as editable text in TextEdit.
QUOTE Thanks
paperclip

 
Member Since: Jun 28, 2008
Posts: 5
paperclip is on a distinguished road

paperclip is offline
Thanks Moe for your suggestion. Your solution worked. Thanks to all who contributed to this post.

Paperclip
QUOTE Thanks

Post Reply New Thread Subscribe


« Improving results in Google searches | How to Publish a page for the Web? »
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
Safari 3.1.1. only slow loading web pages; Firefox ok nauset24 OS X - Apps and Games 17 04-23-2008 05:36 PM
Cannot access certain web pages billy77 Switcher Hangout 5 09-27-2007 04:42 PM
Safari and 'skimming' the new web gallery opus_az OS X - Apps and Games 3 08-09-2007 11:31 PM
The Worst Web Design Techniques Featured on Web Pages novicew Web Design and Hosting 1 03-17-2006 10:31 PM
Blocking Web Addresses in Safari joeyb OS X - Apps and Games 1 02-20-2006 10:08 AM

All times are GMT -4. The time now is 06:47 AM.

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?