Complete newbie question

Discussion in 'HTML' started by Stephen Glynn, Jul 2, 2004.

  1. 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
    Stephen Glynn, Jul 2, 2004
    #1
    1. Advertising

  2. Stephen Glynn

    Deryck Guest

    "Stephen Glynn" <> wrote in message
    news:...
    <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
    Deryck, Jul 2, 2004
    #2
    1. Advertising

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

    > 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.

    --
    Some say the Wired doesn't have political borders like the real world,
    but there are far too many nonsense-spouting anarchists or idiots who
    think that pranks are a revolution.
    Owen Jacobson, Jul 2, 2004
    #3
  4. Stephen Glynn

    Neal Guest

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

    > 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.
    Neal, Jul 2, 2004
    #4
  5. Stephen Glynn <> wrote:

    > <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

    --
    The Doormouse cannot be reached by e-mail without her permission.
    The Doormouse, Jul 2, 2004
    #5
  6. Stephen Glynn

    Sid Ismail Guest

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

    : <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
    Sid Ismail, Jul 2, 2004
    #6
  7. Stephen Glynn

    Mitja Guest

    The Doormouse <>
    (news:Xns951A8A669E3Edoormouseattnet@68.12.19.6) wrote:
    > Stephen Glynn <> wrote:
    >
    >> <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


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

    > 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
    Mitja, Jul 3, 2004
    #7
  8. Stephen Glynn

    Neal Guest

    On Sat, 3 Jul 2004 08:41:13 +0200, Mitja <> wrote:

    > The Doormouse <>
    > (news:Xns951A8A669E3Edoormouseattnet@68.12.19.6) wrote:
    >> Stephen Glynn <> wrote:
    >>
    >>> <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

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


    It's not required, but recommended.
    Neal, Jul 3, 2004
    #8
  9. Stephen Glynn

    rf Guest

    "Neal" <> wrote in message
    news:eek:...
    > On Sat, 3 Jul 2004 08:41:13 +0200, Mitja <> wrote:
    >
    > > The Doormouse <>
    > > (news:Xns951A8A669E3Edoormouseattnet@68.12.19.6) wrote:
    > >> Stephen Glynn <> wrote:
    > >>
    > >>> <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

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

    >
    > It's not required, but recommended.


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

    --
    Cheers
    Richard.
    rf, Jul 3, 2004
    #9
  10. Stephen Glynn

    Neal Guest

    On Sat, 03 Jul 2004 13:48:58 GMT, rf <> wrote:

    >
    > "Neal" <> wrote in message
    > news:eek:...
    >> It's not required, but recommended.

    >
    > 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
    Neal, Jul 3, 2004
    #10
  11. Stephen Glynn

    rf Guest

    Neal wrote:

    > > 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


    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.

    --
    Cheers
    Richard.
    rf, Jul 3, 2004
    #11
  12. Stephen Glynn

    Neal Guest

    On Sat, 03 Jul 2004 14:09:54 GMT, rf <> wrote:

    > Neal wrote:
    >> (regarding using <p> and </p>)
    >> It's recommended by me. :p

    > 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.
    Neal, Jul 3, 2004
    #12
  13. rf wrote:

    > 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.

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me - http://www.goddamn.co.uk/tobyink/?page=132
    Toby A Inkster, Jul 3, 2004
    #13
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Michael Erasmus
    Replies:
    1
    Views:
    380
    avnrao
    May 31, 2004
  2. =?Utf-8?B?TmV3Ymll?=
    Replies:
    1
    Views:
    411
  3. Alan
    Replies:
    1
    Views:
    416
    Patrick TJ McPhee
    Jul 11, 2004
  4. Ralph H. Stoos Jr.

    Help for a complete newbie

    Ralph H. Stoos Jr., Apr 15, 2006, in forum: Python
    Replies:
    10
    Views:
    420
    John Machin
    Apr 16, 2006
  5. Darren

    complete newbie question

    Darren, Mar 27, 2007, in forum: ASP .Net
    Replies:
    3
    Views:
    323
    Hans Kesting
    Mar 27, 2007
Loading...

Share This Page