Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
Locked
0

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

Guest
Jul 16, 2011 Jul 16, 2011

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

TOPICS
Code , How to
48.2K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 16, 2011 Jul 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jul 16, 2011 Jul 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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 16, 2011 Jul 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jul 16, 2011 Jul 16, 2011

When I opened your <www.mytechnet.talktalk.net/welcome.html>

I did get the message properly displayed: Welcome to my first web page

I also checked the welcome file I created and it is welcome.html

Getting curiouser and curiouser!

Larry

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 16, 2011 Jul 16, 2011

It looks like you have saved the file as:

welcome,html

There is a comma after the world welcome.  Can you see it?  Your previous message says this!

hth
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jul 16, 2011 Jul 16, 2011

I checked carefully, re-copied your code in TextEdit - saved as

welcome.html This still opened in browser showing entire coded sequence.

Also tried writing the code in Word, saved as welcome.htm This, too,

failed to display just the desired sentence when opened in the browser.

Maybe it's a gremlin in my new iMac OS X 10.6 ?

L.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 16, 2011 Jul 16, 2011

flammer4 wrote:

I checked carefully, re-copied your code in TextEdit - saved as

welcome.html    This still opened in browser showing entire coded sequence.

Also tried writing the code in Word, saved as welcome.htm    This, too,

failed to display just the desired sentence when opened in the browser.

Maybe it's a gremlin in my new iMac OS X 10.6 ?

L.

Using word is not going to solve your problem because Word by default does not save PURE TEXT characters! word has other formatting characters hidden from your view.  However, if you save Word file as webpage, then it should load fine but the underlying code is likely to be a complete and utter rubbish to  human eye.

Finally, as I don't use Mac OS, I can't think of any other things that might be happening.  I always say to people to use Windows because that is all I use and play with!  This is where my prejudice comes in!

hth

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jul 16, 2011 Jul 16, 2011

Thanks HTH. I'll give it a shot on my old faithful PowerBook, just in case

it's something strange going on in my new iMac! But thanks anyway for all

your help. I'll let you know how it turns out.

Larry

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jul 16, 2011 Jul 16, 2011

Still doesn't work, even on my PowerBook.  I still don't know what I'm doing wrong!

L.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 16, 2011 Jul 16, 2011

flammer4 wrote:

Still doesn't work, even on my PowerBook.  I still don't know what I'm doing wrong!

L.

OK I suggest click on the link I gave you earlier:

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

When it is loaded on your system, Do this:

File >> Save Page As

Keep the name as it is.

Now try to load the page in your browser from your saved location.

Let us know what happens.

Please use Mozilla Firefox as it is faster and better to deal with.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jul 16, 2011 Jul 16, 2011

Now THIS worked! First the message displayed, and when I viewed the page

source, the code that you suggested earlier appeared.

Now, why can't I get this when I enter the code directly?

L.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 16, 2011 Jul 16, 2011

flammer4 wrote:

Now THIS worked!   First the message displayed, and when I viewed the page

source, the code that you suggested earlier appeared.

Now, why can't I get this when I enter the code directly?

L.

This proves what I believed and that is you are not naming the file correctly.  It has got a hidden file extension and if you were using Windows, I would have told you how to reveal the file names properly including hidden extensions of known file names.  I know nothing about MACs so you have yto wait until Murray Summers or John Waller comes here.  They know about Apple MACs and they have been in the business longer than anybody here.

In windows, if we want Notepad to keep the names as it is we normally name the file as:

"welcome.html"       including the quotes so that Notepad will know that it is not the normal text file to be opened in notepad or wordpad (TWO text editors in Windows)

Perhaps you should use my file as a template and then change the text to:

<p>The quick brown fox jumps over the lazy dog.  The quick brown fox jumps over the lazy dog.  The quick brown fox jumps over the lazy dog.  The quick brown fox jumps over the lazy dog.  The quick brown fox jumps over the lazy dog.</p>

Hope this helps.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jul 16, 2011 Jul 16, 2011

Very interesting! I would have thought that the writers of the "DW

Classroom in a Book" would have noted this and provided an alternate

procedure. I need a brain rest - so will come back and try your suggestion

with "The quick brown fox..." later. I'll also read over the article for

which you sent the URL (by David Powers), and start working on the practice

site.

Thanks again for all your help.

Larry

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 16, 2011 Jul 16, 2011

If you want to create very basic HTML files then you can use SeaMonkey (another Mozilla Foundation Project) that comes with Composer to create basic HTML/CSS files.  The link is here:

<http://www.seamonkey-project.org/releases/>

Direct download for Apple Mac is here:

<http://download.mozilla.org/?product=seamonkey-2.2&os=osx&lang=en-US>

SeaMonkey Composer Tutorial Links:

<http://www.google.co.uk/#hl=en&xhr=t&q=SeaMonkey+Composer+Tutorial&cp=19&pf=p&sclient=psy&source=hp&aq=0&aqi=g1&aql=&oq=SeaMonkey+Composer+Tutorial&pbx=1&bav=on.2,or.r_gc.r_pw.&fp=4f061ee8aa4abfcf&biw=1152&bih=678>

hth

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Jul 16, 2011 Jul 16, 2011

I don't think the problem was because of a file extension. From the very fist post, the source showed paragraph tags that could only have been created by the text editor when saving the file as HTML.  I suggest to just save it as a text file then change the extension. On a Mac, this can done even if the dot- txt is not initially displayed.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jul 17, 2011 Jul 17, 2011

Lon,

That worked! I used Word to write the code, saved as .txt file. Then

changed extension to .html That opened just fine in Firefox. When I used

TextEdit, there was no choice of .txt extension, only .rtf - and, of course,

that didn't work. Apparently saving the code directly as .html file inserts

something to keep it from working as an .html file - and that sounds very

strange. But when saved as simple .txt file - then replacing .txt with

.html - voila! Thanks.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Jul 19, 2011 Jul 19, 2011

It just depends on what you're using. Most programs insert what it thinks you need to make it work in a browser. But for the exercises you're doing, all you need is what the exercise calls for, so that's why creating a plain text file works best.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 19, 2011 Jul 19, 2011

If you create a file in a recent or semi-recent version of Word, and use FILE > Save As > (html), the file is saved as *OFFICE SPECIFIC HTML*.  This means that it contains a bunch of code that is targeted at other Office applications, and is completely irrelevant to use on the web.  While this code does not interfere with the ability of the document to function as a web page, it is filler that takes up space and clutters your code.  Honestly, nobody with any experience would ever think of using such a page on the web.

There is nothing magic here.  An HTML file is an HTML file.  Text is text.  The earth is not spinning off its axis....

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 15, 2017 Aug 15, 2017

Trying to get a head start on Web 1 coding for Fall semester code class and a lot of people are having the same problem!!!!

The book i bought for my class was published in 2011, what good is that!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Aug 16, 2017 Aug 16, 2017

You are responding to a thread that is several years old. I suggest creating a new post with details that we could use to reproduce your issue and investigate.

Thanks,

Preran

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 16, 2017 Aug 16, 2017
LATEST

To add to Preran's note, the main forum home page for DW is here: Dreamweaver support forum

If you can't find what you need in the Search function, look for the "Start a new discussion" under the "Still have questions?" header about half way down the page...

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 16, 2011 Oct 16, 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines