473,385 Members | 1,355 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

An other vierd question :-)

Find a page some table cells was made like this:
<td width="253" height="10" bgcolor="98a7b2">Some text in white color</td>

Since the page background was white I could't see the text inside the
cell, with Mozilla. But in IE it shows. The difference is that the color
code don't have the # sign included.

Since that affected the rendering different in browsers, I was very
supriced that the W3C validator don't notice that as an error. Or is it
just Mozilla who required the # sign in the color code?

I have a test on my own here, if interested:
http://w1.978.telia.com/~u97802964/tests/test3.html

--
/Arne
Jul 23 '05 #1
12 1966
us**@domain.invalid wrote:
Find a page some table cells was made like this:
<td width="253" height="10" bgcolor="98a7b2">Some text in white color</td>

Since the page background was white I could't see the text inside the
cell, with Mozilla. But in IE it shows. The difference is that the color
code don't have the # sign included.
IE is forgiving enough (a bad thing) to allow invalid colors. Better
browsers aren't.
Since that affected the rendering different in browsers, I was very
supriced that the W3C validator don't notice that as an error. Or is it
just Mozilla who required the # sign in the color code?


The validator can only validate to DTDs, which aren't very flexible. The
HTML transitional DTD (http://www.w3.org/TR/REC-html40/loose.dtd) only
defines colors as CDATA, which puts very little restriction on their
content.
Jul 23 '05 #2
Once upon a time *Leif K-Brooks* wrote:
us**@domain.invalid wrote:
Find a page some table cells was made like this:
<td width="253" height="10" bgcolor="98a7b2">Some text in white color</td>

Since the page background was white I could't see the text inside the
cell, with Mozilla. But in IE it shows. The difference is that the color
code don't have the # sign included.


IE is forgiving enough (a bad thing) to allow invalid colors. Better
browsers aren't.
Since that affected the rendering different in browsers, I was very
supriced that the W3C validator don't notice that as an error. Or is it
just Mozilla who required the # sign in the color code?


The validator can only validate to DTDs, which aren't very flexible. The
HTML transitional DTD (http://www.w3.org/TR/REC-html40/loose.dtd) only
defines colors as CDATA, which puts very little restriction on their
content.


When I tried the Strict DTD on my test page, I get an error for the
attribute "bgcolor" as I should. But that was only on the line where
color was set with the # sign. The same line with color set without #
passed.

So as it seems, the validator don't even consider the string "bgcolor
color='000000'" as a code. Is it because # is missing? If so, then the
validator must have some "value" for the sign? Am I confused, or am I
really confused :-)

--
/Arne
Jul 23 '05 #3
On Sat, 16 Oct 2004 17:32:00 GMT, <us**@domain.invalid> wrote:
Once upon a time *Leif K-Brooks* wrote:
The validator can only validate to DTDs, which aren't very flexible. The
HTML transitional DTD (http://www.w3.org/TR/REC-html40/loose.dtd) only
defines colors as CDATA, which puts very little restriction on their
content.


When I tried the Strict DTD on my test page, I get an error for the
attribute "bgcolor" as I should. But that was only on the line where
color was set with the # sign. The same line with color set without #
passed.


Yes, because the validator can't tell #XXXXXX is any more right than
XXXXXX. They're both legal values for CDATA, and that's as much as the
validator is able to check. It remains, however, that compliant UAs should
not interpret XXXXXX and should interpret #XXXXXX.
Jul 23 '05 #4
user wrote:
So as it seems, the validator don't even consider the string "bgcolor
color='000000'" as a code. Is it because # is missing? If so, then the
validator must have some "value" for the sign? Am I confused, or am I
really confused :-)


It is *valid* (in an SGML sense) but *wrong*. There is a difference.

Just another example that validating isn't the be all and end all.

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
Now Playing ~ ./ben_folds/sunny_16/05_songs_of_love.ogg

Jul 23 '05 #5
Once upon a time *Toby Inkster* wrote:
user wrote:
So as it seems, the validator don't even consider the string "bgcolor
color='000000'" as a code. Is it because # is missing? If so, then the
validator must have some "value" for the sign? Am I confused, or am I
really confused :-)


It is *valid* (in an SGML sense) but *wrong*. There is a difference.

Just another example that validating isn't the be all and end all.


Well, I guess the only problem here is that some so called webmasters
will maintain they are right only because their pages validate even if
they don't use # :-P

--
/Arne
Jul 23 '05 #6
On Sat, 16 Oct 2004 16:25:40 GMT, us**@domain.invalid wrote:
Find a page some table cells was made like this:
<td width="253" height="10" bgcolor="98a7b2">Some text in white color</td>

Since the page background was white I could't see the text inside the
cell, with Mozilla. But in IE it shows. The difference is that the color
code don't have the # sign included.

Since that affected the rendering different in browsers, I was very
supriced that the W3C validator don't notice that as an error. Or is it
just Mozilla who required the # sign in the color code?


It's a limitation of the validator - the bgcolor attribute is defined
as taking values from the set %color and %color is defined as CDATA
which more or less means anything. This is because in HTML colours can
be either #RRGGBB or one of 16 keywords. The limitations on what's an
acceptable value are in the prose of the specification rather than in
the DTD.

Hence, Mozilla is correct in ingoring the incorrect value and the
validator is correct in not reporting it as a validity error. IE, of
course, is correcting the error behind the scenes.

Steve

Jul 23 '05 #7
On Sat, 16 Oct 2004 17:32:00 GMT, us**@domain.invalid wrote:
Once upon a time *Leif K-Brooks* wrote:
us**@domain.invalid wrote:

<td width="253" height="10" bgcolor="98a7b2">Some text in white color</td>

Since that affected the rendering different in browsers, I was very
supriced that the W3C validator don't notice that as an error. Or is it
just Mozilla who required the # sign in the color code?


The validator can only validate to DTDs, which aren't very flexible. The
HTML transitional DTD (http://www.w3.org/TR/REC-html40/loose.dtd) only
defines colors as CDATA, which puts very little restriction on their
content.


When I tried the Strict DTD on my test page, I get an error for the
attribute "bgcolor" as I should. But that was only on the line where
color was set with the # sign. The same line with color set without #
passed.


Under ths Strict DTD bgcolor isn't a permitted attribute at all. Use
CSS instead. The validator only reports the first instance of a
non-valid attribute so that's why the second (and subsequent) one was
ignored.

Steve

Jul 23 '05 #8
us**@domain.invalid wrote:
some so called webmasters will maintain they are right only because
their pages validate


They are unquestionably wrong. A document can be obviously in violation
of html recommendations and still be valid. Valid in SGML terms only
means that the document adheres to the formal syntax of a dtd.
--
Brian (remove "invalid" to email me)
Jul 23 '05 #9
Once upon a time *Brian* wrote:
us**@domain.invalid wrote:
some so called webmasters will maintain they are right only because
their pages validate


They are unquestionably wrong. A document can be obviously in violation
of html recommendations and still be valid. Valid in SGML terms only
means that the document adheres to the formal syntax of a dtd.


Just found out that IE does the right thing if CSS is used for the color
settings, and don't try to correct "xxxxxx" as it does with the
depricated "bgcolor". Let's hope the webmasters use more CSS :-)

--
/Arne

VARNING: Konsumtion av alkohol kan få dig att tro att du kan ha föra ett
vettigt samtal med någon av det andra könet, utan att spotta.
Jul 23 '05 #10
Brian wrote:
They are unquestionably wrong. A document can be obviously in violation
of html recommendations and still be valid. Valid in SGML terms only
means that the document adheres to the formal syntax of a dtd.


The simple example is:

<p>The cat sat on teh mat.</p>

Obvious mistake, but it's not invalid.

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact

Jul 23 '05 #11
Toby Inkster wrote:
Brian wrote:

They are unquestionably wrong. A document can be obviously in violation
of html recommendations and still be valid. Valid in SGML terms only
means that the document adheres to the formal syntax of a dtd.

The simple example is:

<p>The cat sat on teh mat.</p>

Obvious mistake, but it's not invalid.


:-D Humerous, but not on point. There's no markup error in your
example. But you can have clear markup errors without having invalid
markup:

<P lang="thisIsAnExampleOfIncorrectMarkup">There is no validation error
here.</P>.

--
Brian (remove "invalid" to email me)
Jul 23 '05 #12

"Toby Inkster" <us**********@tobyinkster.co.uk> wrote in message
news:pa****************************@tobyinkster.co .uk...
Brian wrote:
They are unquestionably wrong. A document can be obviously in violation
of html recommendations and still be valid. Valid in SGML terms only
means that the document adheres to the formal syntax of a dtd.


The simple example is:

<p>The cat sat on teh mat.</p>

Obvious mistake, but it's not invalid.


Or "Colorless green dreams sleep furiously". Syntactically and
orthographically correct, semantically flawed. (In case you want to take
issue with the orthographic part, let me rewrite it as "Colourless green
dreams sleep furiously.")

Jul 23 '05 #13

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: andrew | last post by:
Hi, i have a problem that i can't solve for quite a long time. I created a dll with C# and added a reference to it in my project. i create an object from that dll (TableControl), in this object...
4
by: user | last post by:
I came across a frames set built site and found out that in IE the main frame (only frame with scrolling allowed) have a horizontal scroll list. Since Mozilla don't show that list, I get curious...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.