IntelliJ Java IDE
The moose likes HTML, CSS and JavaScript and the fly likes Validation Error with Image and Link Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of Practical Unit Testing with TestNG and Mockito this week in the Testing forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply Bookmark "Validation Error with Image and Link" Watch "Validation Error with Image and Link" New topic
Author

Validation Error with Image and Link

Matthias TMC
Greenhorn

Joined: Mar 19, 2004
Posts: 4
Hi all,
I do have a html-document which I would like to pass the w3 validation service (http://validator.w3.org)with no error.
The html I've tested: web page
Problem: There is one error with the border attribute:
1. Line 18, column 135: there is no attribute "BORDER" (explain...).

My line 18:
<a href="http://www.atnotes.de"><img width="53" height="22" alt="Home" src="http://217.160.137.156/yabbse/YaBBImages/home.gif" border="0"></a>
My line 19 has the same attribute, but no error appears:
<a href="http://217.160.137.156/yabbse/YaBBHelp/index.html"><img width="47" height="22" alt="Help" src="http://217.160.137.156/yabbse/YaBBImages/help.gif" border="0"></a>
Any idea why there is a problem with line 18 (but not with line 19) ?
Many thanks in advance.
Regards,
Matthias
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15003
border is not supported if I remember correctly since you are supposed to use a style sheet for it....
I am no XHTML expert, but I think that is the cause...
Eric
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15003
if you go here: http://www.macromedia.com/devnet/mx/dreamweaver/articles/code_standards.html
and I am correct with what I said above...
goto that page and search for border (about 1/3 of the page), it tells you how to fix it.
Eric
Matthias TMC
Greenhorn

Joined: Mar 19, 2004
Posts: 4
Thanks Eric.
I've tried to reproduce this.
But the only thing Dreamweaver is changing is adding the "border: 0px" in the CSS.
So, I have included the line "border: 0px" in the CSS and deleted the border="0" in the HTML. But now an ugly border appears around the image (Mozilla Firefox, IE).
Unfortunately, Dreamweaver is not perfect for strict HTML/CSS code as we all know. I've also tried to create a hyperlink on a image with Dreamweaver, but I got the same result with the validator.
Any other idea out there? I wonder why there are no more questions about this issue. I think on almost every website there is an image with hyperlink. Maybe a bug in the validator?
Regards,
Matthias
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15003
border is not allowed, along with alot of other things.
a style sheet is need to be used...
here is an example:
Matthias TMC
Greenhorn

Joined: Mar 19, 2004
Posts: 4
Many thanks Eric.
Now I've used the "border:0px;" in the style sheet and it works perfect.

Regards,
Matthias
 
 
subject: Validation Error with Image and Link
 
Threads others viewed
Expression Language not supported in compile time attribute items
reg html tables
GET html contents from a web server
Multiple bundles broke my app(properties file)
urgent help in jsp taglib
IntelliJ Java IDE