Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Skeva

macrumors newbie
Original poster
Mar 9, 2008
6
0
Hey folks, I am pretty new to html coding and i am doing some testing on my iMac, but when i open the html file i saved in class in Safari or Firefox it just shows up as text, i got some sample html from a google search that i know works but still didnt work.

Is there something on my iMac i need to do to fix the issue?

Thanks:)

My sample code is

<html>

<head>
<title> favorites / bookmark title goes here </title>
</head>

<body bgcolor="white" text="blue">

<h1> My first page </h1>

This is my first web page and I can say anything I want in here - I do that by putting text or images in the body section - where I'm typing right now :)

</body>

</html>
 
I am guessing your saving it at a text file instead of a html file.

Try renaming your file something.html, its likely you have it as something.txt or something.html.txt
 
Cabbit probably nailed it.

Make sure you're using an honest-to-goodness plain text editor. Maybe someone can recommend a good free solution. I use BBEdit, but that's not really a viable option for someone just starting out unless they want to fork over whatever it is they're charging these days...
 
Definitely go into the finder and enable the ability to see the file extensions.

"index.html.txt" is a very likely possibility, but it's hard to tell if all you see is "index"
 
As others have said, check your file name doesn't have .txt on the end.

Also, instead of text="blue", I recommend style="color: blue;"

the text="" attribute isn't well supported any more.
 
the text="" attribute isn't well supported any more.
By what? It is deprecated/excluded in current web standards but I don't recall hearing of any browser actually dropping support for it. The CSS declaration is better, of course, and better still would be studying CSS and using proper stylesheets (inline or external) wherever appropriate.
 
if it's on your computer

and testing... anything name will work as long as u save it as .html As an example, name.html Make sure you are NOT using rich text formal in text edit. It has to be plain text format.

If you are uploading to a server. Some servers prefer... index.html, some, home, and some default. Try all three. htmk is easy, u will learn it in a week.

This is the best for beginners. Thats how I learned.
 
By what? It is deprecated/excluded in current web standards but I don't recall hearing of any browser actually dropping support for it. The CSS declaration is better, of course, and better still would be studying CSS and using proper stylesheets (inline or external) wherever appropriate.

It was a minor aside, not really relevant to the main issue at hand.

Of course browsers will support the old tag, and the tag isn't part of HTML 4 (Strict) or HTML 5 or, of course XHTML. But then again, someone creating this simple example probably wants his page to load as HTML and doesn't care for doctypes and standards.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.