Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Validating pages in XHTML

Status
Not open for further replies.

kimb

Technical User
Jun 30, 2002
39
0
0
NZ
Hi, I'm trying to validate my web pages in XHTML through the w3schools validator. I keep seeming to get a similar error - if my html says <hr width=&quot;90%&quot; size=&quot;2&quot; /> I get the error message &quot;there was no attribute &quot;width&quot;&quot; as well as &quot;there was no attribute &quot;size&quot;&quot;.

I've read through their reason, but for the life of me I can't understand it.

Does anyone know ... in laymens terms ... why I keep getting this message?

Thanks
Kim
 
Erm... Well it means what it says - <hr> elements do not have width and size attributes in strict XHTML, you're supposed to use CSS instead. See



If you want to use these attributes (and my advice would to do so, if you want to support the widest range of browsers) try validating to XHTML Transitional instead of XHTML Strict. You can get the relevant doctype definition from here:


-- Chris Hunt
Extra Connections Ltd
 
Yep. You would use
Code:
<hr class=&quot;FreestyleRollerbladingHippieChick&quot;></hr>
and then somewhere in your stylesheet you define
Code:
hr.FreestyleRollerbladingHippieChick
  {
    color=#88ff55;
  }
but adding your own values, of course.

Be aware that not all browsers will support all values, so you might look into other ways of making cute horizontal lines.

Cheers,


[monkey] Edward [monkey]

&quot;Cut a hole in the door. Hang a flap. Criminy, why didn't I think of this earlier?!&quot; -- inventor of the cat door
 
Thanks for that - after validating my pages now look a lot less scary!
Kim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top