body text= tags do not work

Discussion in 'HTML' started by Rob, Aug 2, 2008.

  1. Rob

    Rob Guest

    Hi,

    When trying to change the text color of a paragraph I saw that the tag
    <body text="#FFFF00"> has no effect at all.
    The text which should be yellow, remails white (on a black
    background).

    My page is structured in a very simple way, like this:

    <html>
    <body>

    blablabla
    blablabla
    blablabla


    </body>
    </html>


    What I tried was:

    <html>
    <body>

    blablabla
    blablabla
    </body>
    <body text="#FFFF00">
    blablabla
    </body>
    blablabla
    </body>
    </html>

    The result was: no change at all in the color of the text (all of the
    text was visible).
    This happened both in MSIE and in Mozilla Filrefox.

    What did I do wrong and how can I get my colors?

    Thanks for your reply,

    Rob.
     
    Rob, Aug 2, 2008
    #1
    1. Advertising

  2. Rob

    J.O. Aho Guest

    Rob wrote:
    > Hi,
    >
    > When trying to change the text color of a paragraph I saw that the tag
    > <body text="#FFFF00"> has no effect at all.
    > The text which should be yellow, remails white (on a black
    > background).


    You are allowed to have one body in the page, all extra ones are ignored.

    You can use css to get the color of your taste.

    a simple example would be

    <div style="color: yellow;">your yellow text here</div>


    --

    //Aho
     
    J.O. Aho, Aug 2, 2008
    #2
    1. Advertising

  3. Rob

    Rob Guest

    Op Sat, 02 Aug 2008 13:21:44 +0200, "J.O. Aho" <>
    schreef:

    >Rob wrote:
    >You are allowed to have one body in the page, all extra ones are ignored.
    >
    >You can use css to get the color of your taste.
    >
    >a simple example would be
    >
    ><div style="color: yellow;">your yellow text here</div>
    >

    Perfect, thanks!!!

    Rob.


    >
    >--
    >
    > //Aho
     
    Rob, Aug 2, 2008
    #3
  4. Rob wrote:
    > Hi,
    >
    > When trying to change the text color of a paragraph I saw that the tag
    > <body text="#FFFF00"> has no effect at all.


    Why on earth would you think that it would?
     
    Harlan Messinger, Aug 3, 2008
    #4
  5. Rob

    Andy Dingley Guest

    On 2 Aug, 12:10, (Rob) wrote:

    > What did I do wrong and how can I get my colors?


    Colors: //Aho has given you an answwer already.

    What did you do wrong? Something that's not uncommon, but doesn't
    work any better no matter how many people try it. HTML has a defined
    structure to it. You can't mess with this, you can't invent new ways
    of doing things, just because you think, "that's how it ought to
    work". Maybe it is - maybe your great new idea would indeed be better:
    except that it isn't how the browsers are coded to work, so it isn't
    how they're going to render your page when they receive it. You have
    to play by HTML's rules, or else it doesn't work.

    Of course you don't _have_to_ follow HTML's rules. No one dies. But if
    you don't, it doesn't work.

    It's sometimes said that you _shouldn't_ follow HTML's rules. If you
    use tricksy little gimmicks, then you can make things work "better"
    than by following the rules. You'll be a rad design-d00d and your
    pages will r4wk. Rubbish. If you can get something to work by doing it
    wrong, you can get it to work equally well by doing it right. It's
    also easier that way.

    Why is it easier? Obviously learning to get HTML right is at least
    _some_ extra work over doing it any old how. So "correct" must be
    harder? Actually it's not. This is because there's only one "correct",
    and it's written down in the HTML spec. "Wrong" HTML, or "HTML that
    works kind of OK on one browser" comes in any number of different
    flavours and they're not clearly documented. So although it's not
    trivial to learn the right way, at least you only have to do it once,
    from one source, and then it's right on every browser. That's a _lot_
    easier than finding a "wrong but workable" way that's consistent
    between browsers.

    How to learn it? This is tricky - most of the refs out there are
    badly done and frequently themselves wrong. IMHO there's barely one
    book worth reading as a primer (Head First HTML with CSS & XHTML) and
    possibly one website (http://htmldog.net) and even that's not perfect.
    Once you've gone through a basic tutorial, start trying to read the
    official W3C HTML specs (and not W3CSchools, who are just a bunch of
    fakers passing themselves off as the W3C!). Keep reading this
    newsgroup and c.i.w.a.h too.
     
    Andy Dingley, Aug 4, 2008
    #5
  6. Rob

    Ari Heino Guest

    > IMHO there's barely one
    > book worth reading as a primer (Head First HTML with CSS & XHTML) and
    > possibly one website (http://htmldog.net) and even that's not perfect.


    I guess you meant http://htmldog.com/

    --
    Ari
     
    Ari Heino, Aug 4, 2008
    #6
  7. Rob

    Andy Dingley Guest

    On 4 Aug, 10:32, Ari Heino <> wrote:
    > > IMHO there's barely one
    > > book worth reading as a primer (Head First HTML with CSS & XHTML) and
    > > possibly one website (http://htmldog.net) and even that's not perfect.

    >
    > I guess you meanthttp://htmldog.com/


    That's the one, thanks.
     
    Andy Dingley, Aug 4, 2008
    #7
  8. Rob

    Rob Guest

    What did I do wrong?
    Well, I took a HTML tutorial book, looked up 'color' in the index and
    followed the instructions on the page mentioned in the aforesaid
    index.
    There was no warning on the page about not using the tag <body> more
    than once.
    BTW, 'body' or 'tag body' is NOT in the index.
    I looked for a mention that the tag 'body' can be used only once, but
    I did not see it.

    Very useful book!

    Kind regards,

    Rob.




    Op Mon, 4 Aug 2008 02:46:05 -0700 (PDT), Andy Dingley
    <> schreef:

    >On 4 Aug, 10:32, Ari Heino <> wrote:
    >> > IMHO there's barely one
    >> > book worth reading as a primer (Head First HTML with CSS & XHTML) and
    >> > possibly one website (http://htmldog.net) and even that's not perfect.

    >>
    >> I guess you meanthttp://htmldog.com/

    >
    >That's the one, thanks.
     
    Rob, Aug 4, 2008
    #8
  9. Rob

    Rob Guest

    Never mind, it's not in English anyhow.

    It dates from a few years ago, but already has HLML version4.

    Kind regards,

    Rob.



    Op Tue, 05 Aug 2008 01:09:31 +0100, Andy Dingley
    <> schreef:

    >On Mon, 04 Aug 2008 19:51:21 GMT, (Rob) wrote:
    >
    >>Well, I took a HTML tutorial book, looked up 'color' in the index and
    >>followed the instructions on the page

    >
    >Which book was it?
    >
    >How old was it?
    >
    >Note the part where I stated that nearly all HTML tutorials are
    >frequently wrong.
    >
     
    Rob, Aug 5, 2008
    #9
  10. jACK wrote:
    >
    > Some of you people here are getting to be a shame to the group.
    >
    > Perfect example here. 44 lines of lecture, and not a one to help the
    > poor guy. You could have gone a long way to help him with the problem
    > in the same 44 lines.
    >
    > No, you have to show your smarts with your lecture.


    People tend not to want to do other people's homework for them, whether
    literally or figuratively. If a person is just making up even the most
    fundamental aspects of creating a web page and expecting it to work
    (honestly, no tutorial or reference work taught him that the body tag
    has a text attribute), something to the effect of "You need to read
    about how this works for real if you expect to accomplish anything" is a
    legitimate response. And in case you didn't notice, the final paragraph
    of Andy's reply was full of helpful advice on how to learn how HTML works.
     
    Harlan Messinger, Aug 9, 2008
    #10
    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. Big D
    Replies:
    2
    Views:
    340
    Jeffrey Tan[MSFT]
    Jan 6, 2004
  2. Rob Nicholson
    Replies:
    3
    Views:
    756
    Rob Nicholson
    May 28, 2005
  3. Replies:
    0
    Views:
    99
  4. London Boy
    Replies:
    2
    Views:
    335
    Keith Bowes
    Jan 12, 2004
  5. Replies:
    5
    Views:
    213
    A. Sinan Unur
    Sep 8, 2005
Loading...

Share This Page