Complete newbie question

S

Stephen Glynn

Can anyone advise me on this or suggest a group where I might seek help?

I'm trying to work through an introductory exercise in QUE books' "Using
HTML". This involves writing some text in notepad and then adding
tags to produce a basic home page for some imaginary family.

What they tell me to enter is

<HTML>
<HEAD>
<TITLE>The Fayne Family Page</TITLE>
</HEAD>
<BODY bgcolor="FFFFFF" text="000000" link = "0000FF" alink="FF0000"
vlink="800000>

<H1>The Fayne Family Page</H1>
<H2>Who We Are</H2>
<P>

.... some text...

<H2>Where We Live</H2>
<P>

.... some more text ...

<H2>Our Special Interests</H2>
<P>
.... some more text ...

<H2>Fun Places We've Been</H2>
<P>
.... yet more text ...
</BODY>
</HTML>

This causes the first two paragraphs to vanish, though the last two --
"Our Special Interests" and "Fun Places We've Been" -- display as the
book suggests they should, at least in Mozilla 1.6 and IE6. Removing

<BODY bgcolor="FFFFFF" text="000000" link = "0000FF" alink="FF0000"
vlink="800000>

and replacing it with <BODY>, on the other hand, displays the full
exercise as it's supposed to appear.

Where have I gone wrong?

Steve
 
D

Deryck

<BODY bgcolor="FFFFFF" text="000000" link = "0000FF" alink="FF0000"
vlink="800000>Start by putting a " before the > in the above line. That certainly causes
IE a problem on my machine although not the one you describe.
Post the URL of the file too if you can please.

HTH
Deryck
 
O

Owen Jacobson

This causes the first two paragraphs to vanish, though the last two --
"Our Special Interests" and "Fun Places We've Been" -- display as the
book suggests they should, at least in Mozilla 1.6 and IE6. Removing

<BODY bgcolor="FFFFFF" text="000000" link = "0000FF" alink="FF0000"
vlink="800000>
^^ you missed a double quote.

Also, numeric colour constants must begin with a hash (#).
and replacing it with <BODY>, on the other hand, displays the full
exercise as it's supposed to appear.

Where have I gone wrong?

Don't use the deprecated body attributes to style the page. Use a
stylesheet.
 
N

Neal

Can anyone advise me on this or suggest a group where I might seek help?

I'm trying to work through an introductory exercise in QUE books' "Using
HTML". This involves writing some text in notepad and then adding
tags to produce a basic home page for some imaginary family.

What they tell me to enter is

(essentially ok code snipped)

This causes the first two paragraphs to vanish, though the last two --
"Our Special Interests" and "Fun Places We've Been" -- display as the
book suggests they should, at least in Mozilla 1.6 and IE6. Removing

<BODY bgcolor="FFFFFF" text="000000" link = "0000FF" alink="FF0000"
vlink="800000>

and replacing it with <BODY>, on the other hand, displays the full
exercise as it's supposed to appear.

Where have I gone wrong?

Steve

Change your open body tag to:

<BODY bgcolor="#FFFFFF" text="#000000" link="#0000FF" alink="#FF0000"
vlink="#800000">

If this doesn't fix it, post a URL to a live example.

If that's not what the book tells you (as in, it wasn't your typo that
produced the erroneous body tag), throw it away. Far away. It's a litle
dated anyhow.

Actually, the modern way to do this would be more along the lines of:

<html>
<head>
<title>This is the title</title>
<style type="text/css">
body {
background-color: #ffffff;
color: #000000;
}
a:link {
color: #0000ff;
background-color: inherit;
}
a:visited {
color: #800000;
background-color: inherit;
}
a:active {
color: #ff0000;
background-color: inherit;
}
</style>
</head>
<body>
--- content ---
</body>
</html>

One more tip - use <p> to start a paragraph, and use </p> to end it. You
don't need to, it's not required, but it's a good habit to develop for the
possible future.
 
T

The Doormouse

Stephen Glynn said:
<BODY bgcolor="FFFFFF" text="000000" link = "0000FF" alink="FF0000"
vlink="800000>

Change this to <body> and remember that every tag has a start and an end.

For example:
<p>your text here</p> <-- it's important to close most tags this way

There is no need for the bgcolor, text, link and other items.
Those attributes (That's what they are called) are wasted space.

Later, you will use attributes - but not now.

The Doormouse
 
S

Sid Ismail

On Fri, 02 Jul 2004 19:31:13 +0100, Stephen Glynn

: <BODY bgcolor="FFFFFF" text="000000" link = "0000FF" alink="FF0000"
: vlink="800000>


Add the close quote, and the first 2 paragraphs reappear quite magically.
Even David Copperfield will be proud of you!

Sid
 
M

Mitja

The Doormouse said:
Change this to <body> and remember that every tag has a start and an
end.

For example:
<p>your text here</p> <-- it's important to close most tags this way

A bit unlucky choice...
Paragraph closing is optional in HTML.
 
N

Neal

The HTML 4.01 spec states that </p> is optional. Please point out where
the
spec says it is recommended.

I didn't say the spec says it was recommended. :) I said it's recommended.

It's recommended by me. :p
 
R

rf

Neal said:
I didn't say the spec says it was recommended. :) I said it's recommended.

It's recommended by me. :p

And your credentials are?

BTW I agree(a) with you. Closing tags should be used for all elements that
are not empty. *My* reasoning is:

1) How does one remember which non-empty HTML 4.x elements require closing
tags and which do not. It is easier to close all of them.

2) One of these days we may have to move to XHTML(b) where *all* elements
are required to be closed. Closing all of them now will make that future
legacy code easier to bring up to date.

(a) It is still not "recommended", simply good practice. If you provide the
above two qualifiers you may be entitled to say "recommended". If you don't
then you must cite a source for that "recommendation".

(b) Not likely but a posssibility. After all in 1984 we never would have
thought that it would be *required* to use 32 bit memory addressing.
 
N

Neal

And your credentials are?

Simply that I'm smart enough to listen to and learn from those smarter
than me... and those individuals have shown that it's smart to do this.
BTW I agree(a) with you. Closing tags should be used for all elements
that
are not empty. *My* reasoning is:

1) How does one remember which non-empty HTML 4.x elements require
closing
tags and which do not. It is easier to close all of them.

2) One of these days we may have to move to XHTML(b) where *all* elements
are required to be closed. Closing all of them now will make that future
legacy code easier to bring up to date.

Those are my usual arguments as well. Being that those have been presented
in this ng often, I figured it was not necessary to repeat.
 
T

Toby A Inkster

rf said:
After all in 1984 we never would have thought that it would be
*required* to use 32 bit memory addressing.

Unless it were enforced by Big Brother.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top