I'm a C++ developer and thought I would learn HTML, however I'm stuck at the very first hurdle. All the tutorials say if I save a file as .htm or .html then open it in the browser it'll be displayed as a web page. Except its not, its instead displaying the source code. I've tried with Safari and Firefox on Mac and IE on XP.
I am saving the following text as xxx.html, then choosing file/open file. How do I get it to display the <body> content in the browser window and not the entire source code?
<html> ?<head> ?<title>Test Page</title> ?</head> ?<body> ?Hi there, you have just written your first Web page! ?</body> ?</html>
Thanks for the suggestions, however
I've tried with a suffix of .htm and .html and its the same.
I've tried opening the file by right clicking and choosing open as with the browsers - same result.
And the code displays properly with that test tool.
Any other suggestions?
P.S.
On the Mac I created it with TextEdit, and saving it using the explicit save as web page which gives it a .html extension by default.
I've found out its something to do with Apple's TextEdit program, don't know what at the moment though. I'll grab a different editor and see what the difference is.
Solved it - TextEdit by default formats the content as rich text, need to change it plain text.
I am saving the following text as xxx.html, then choosing file/open file. How do I get it to display the <body> content in the browser window and not the entire source code?
<html> ?<head> ?<title>Test Page</title> ?</head> ?<body> ?Hi there, you have just written your first Web page! ?</body> ?</html>
Thanks for the suggestions, however
I've tried with a suffix of .htm and .html and its the same.
I've tried opening the file by right clicking and choosing open as with the browsers - same result.
And the code displays properly with that test tool.
Any other suggestions?
P.S.
On the Mac I created it with TextEdit, and saving it using the explicit save as web page which gives it a .html extension by default.
I've found out its something to do with Apple's TextEdit program, don't know what at the moment though. I'll grab a different editor and see what the difference is.
Solved it - TextEdit by default formats the content as rich text, need to change it plain text.