CSS Validation Error

I have this failure from: click here

Same colors for color and background-color in two contexts .content3 hr and h1.

This is the CSS responsible:

.content1 hr, .content2 hr, .content3 hr {
/* background-color has been added to allow hr display in compliant browsers e.g. FFox. Color is there for IE. Otherwise hr is not displayed in the respective browser*/
height: 2px;
clear: both;
border: 0;
width: 100%;
color: #0c578d;
background-color: #0c578d;
}

You can see that I have a simple hr /> in the strict html code. It is always on a line of its own and is used to underline sections of content e.g.:

.
.
.
p>Whilst every effort is made to keep the information up-to-date please always check to make sure about important details and events in which you have an interest. /p>
hr />
/div>

Does anyone know why I need both background and color to get the same color in all browsers?

  PurplePenny 22:09 15 Jan 07

Have I misunderstood what you are doing? Why do you need color for an hr: color doesn't apply to backgrounds it applies to text. The validator is telling you that your text and the background behind it are the same colour.

I want it blue. FFox needs background to colour it and IE(6) needs color to colour it blue. If I leave either out it defaults.

Opera & Netscape behave as FFox

  PurplePenny 20:36 16 Jan 07

I've just checked O'Reilly's HTML & XHTML Definitive Guide and indeed IE does use "color" to colour an HR but it is not supported by the other browsers. By default a rule is set to the same colour as the page background with a chiselled effect in a darker shade. That is why the background-color works in the other browsers.

It seems that there is nothing that you can do about it so just ignore the CSS validator's warning. A validator warning doesn't mean the CSS has failed it really is just warning you that something in your CSS might mean it doesn't display the way that you expect (in this case it thinks you have some text that is the same colour as the background).

I am new to this lark and am just completing a project and was trying to get the anchor tag working properly in IE. I noticed that if you are tabbing through the anchors and hit HOME or CNTRL HOME whilst the browsers take you to the top of the page it does not reset the tabbing order. So if you tab now you reappear down below the last tab before hitting the HOME key. Jim Thatcher seems to think this behaviour is odd.

Would be interested in other opinions on this one.

This thread is now locked and can not be replied to.

Best phone camera 2016/2017: Galaxy S7 vs iPhone 7 vs Google Pixel vs HTC 10 Evo vs OnePlus 3T vs…

1995-2015: How technology has changed the world in 20 years

Best Christmas Agency Projects of 2016

Super Mario Run preview | Hands-on first impressions of Super Mario Run: Mario's iPhone & iPad…