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

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 UTC