Skip to main content
July 16, 2011
Question

[Locked] Why does my html code not display in browser as expected?

  • July 16, 2011
  • 2 replies
  • 48656 views

Dreamweaver Support

I am using Adobe Dreamweaver CS5 Classroom in a Book.

In chapter 2, pp 23-24, I typed in the brief html code in the TextEdit application on my iMac - saved as firstpage.html:

<html>

<body>

Welcome to my first web page

</body>

</html>

Then I launched my Firefox browser and opened that firstpage html file there.  The browser displayed my entire html code – not just the expected text: “Welcome to my first web page.”

When I went to VIEW and clicked on Page Source, I got the browser page code with my code (above) included, but there was strange code in front of each of my lines:

<body>

<p class="p1">&lt;html&gt;</p>

<p class="p1">&lt;body&gt;</p>

<p class="p2">Welcome to my first web page</p>

<p class="p2">&lt;/body&gt;</p>

<p class="p2">&lt;/html&gt;</p>

</body>

</html>

On each line, the initial p  and terminal p are purple;  the “pl” is blue, and the lt;   and  gt; are red.

What happened here?  Since the lesson continues to use the original code (adds to it, etc.) I need to know how to do this right.

Thank you,

Larry Flammer

Flammer4@gmail.com

This topic has been closed for replies.

2 replies

Participant
October 17, 2011

I found this on other website, and it works for me, you just need to change the preferences on TextEdit.

1. Open TextEdit.
2. Choose Preferences from the TextEdit application menu.
3. Click the Plain Text radio button for New Document Format.
4. Under Saving, click the checkbox to turn off "Append '.txt' extension to plain text files."
5. Under Rich text processing, click the checkbox to turn on "Ignore rich text commands in HTML files."
6. Be sure the checkbox for "Wrap to Page" is deselected.

mytaxsite
Inspiring
July 16, 2011

The reason is you haven't created a proper webpage.  It should be done this way:

<html>

<head>

<title> </title>
</head>

<body>
Welcome to my first web page
</body>

</html>

When you have finished typing this, you should always save the file as: welcome.htm"   or "welcome.html"  both names without the quotes.

This should give you a start.

July 16, 2011

THANK YOU - for your quick and direct reply, however, when I selected,

copied and pasted what you showed me (in TextEdit), and saved as

welcome,html that new file still opened in Firefox displaying the entire

code as typed! This is crazy. I have used html a bit off and on over the

years, but never encountered this problem. Anything else I might try?

Larry

mytaxsite
Inspiring
July 16, 2011

flammer4 wrote:

THANK YOU - for your quick and direct reply, however, when I selected,

copied and pasted what you showed me (in TextEdit), and saved as

welcome,html  that new file still opened in Firefox displaying the entire

code as typed!  This is crazy.  I have used html a bit off and on over the

years, but never encountered this problem.  Anything else I might try?

Larry

are you sure you are saving as a dot html file?  Sometimes some text editors always add dot txt after the name you type.  Your file must have been saved as:

welcome.html.txt

Have a look at this link in your browser:

<http://www.mytechnet.talktalk.net/welcome.html>

Hope this helps.