body text= tags do not work

R

Rob

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

J.O. Aho

Rob said:
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>
 
R

Rob

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

Harlan Messinger

Rob said:
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?
 
A

Andy Dingley

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

Rob

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
 
R

Rob

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
 
H

Harlan Messinger

jACK said:
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.
 

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,777
Messages
2,569,604
Members
45,227
Latest member
Daniella65

Latest Threads

Top