W3C home > Mailing lists > Public > www-validator@w3.org > August 2012

Re: Validation error <hr color="red" width="1200" size="1">

From: Jukka K. Korpela <jkorpela@cs.tut.fi>
Date: Sun, 12 Aug 2012 19:45:33 +0300
Message-ID: <5027DDAD.2010806@cs.tut.fi>
To: Matthew <mla@asisbiz.com>
CC: www-validator@w3.org
2012-08-10 14:57, Matthew wrote:

> |I keep getting an error message although the code is correct.

The code is not correct according to the document type declaration in 
your document.

> What is wrong with this code?
> Matthew
> Web developer for Asisbiz.com and others
>
> <hr color=*"*red" width="1200" size="1">|

Apparently the problem is (at least) with the page http://www.asisbiz.com
It declares HTML 4.01 Transitional. However, that version of HTML, or 
any published version of HTML for that matter, does not include the 
color attribute for <hr>; see
http://www.w3.org/TR/html4/present/graphics.html#edef-HR

Your options:
1) Ignore the message. (The color property works on some browsers, fails 
on some. Validator messages do not affect this.)
2) Use a custom DTD that allows the attribute. Not very practical.
3) Replace the attribute by the use of CSS, e.g. using the attribute
style="color: red; background: red".
4) Replace the entire <hr> element by CSS settings that set a bottom 
border for the preceding element or a top border for the following element.

Yucca
Received on Sunday, 12 August 2012 16:46:04 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Sunday, 12 August 2012 16:46:10 GMT