Discussion:
HTML validation issues.
(too old to reply)
John Swan
2006-07-31 13:41:37 UTC
Permalink
Hello.

I have created a website which does not seem to validate correctly. I am
only getting one error but to rectify this issue would result in part of the
site not working.

Basically I have a div which is nested inside a link. When the validator
parses this it throws an error, having tried different combinations that
does not work. Please check out the other pages on the site to see what I
mean (any opinions would be appreciated :) )

I know there is a easy fix which would be to include the image in the <a>
but that would defeat the point of style sheets and make mobile users of
limited browsers download a big image that would take time and look even
worse.


Please check out www.integrated-dev-sol.co.uk/index.html for more info or
simply click upon the following link:
http://validator.w3.org
and enter the above url.
--
www.integrated-dev-sol.co.uk
Remove 123 from email address to reply.
Anti spam and virus measure.
Adrienne Boswell
2006-08-02 03:51:00 UTC
Permalink
Gazing into my crystal ball I observed "John Swan"
Post by John Swan
Hello.
I have created a website which does not seem to validate correctly. I
am only getting one error but to rectify this issue would result in
part of the site not working.
Basically I have a div which is nested inside a link. When the
validator parses this it throws an error, having tried different
combinations that does not work. Please check out the other pages on
the site to see what I mean (any opinions would be appreciated :) )
I know there is a easy fix which would be to include the image in the
<a> but that would defeat the point of style sheets and make mobile
users of limited browsers download a big image that would take time
and look even worse.
Please check out www.integrated-dev-sol.co.uk/index.html for more info
http://validator.w3.org
and enter the above url.
Why would you nest a div inside of a link - DIV is a block level element,
A is inline and cannot contain block level elements.

If you want A to show as blocklevel, the use CSS to do so.

As to your problem with the image, you could do this:

@media screen {
img.bigimg {display:inline}
}
@media handheld {
img.bigimg {display:none}
}

<a href="page.html"><img src="bigimg.jpg" class="bigimg" alt="Large
image" height="500" width="500"></a>
--
Adrienne Boswell at Home
Arbpen Web Site Design Services
http://www.cavalcade-of-coding.info
Please respond to the group so others can share
Integrated Development Solutions
2006-08-03 16:47:53 UTC
Permalink
Well because the div is just an image. And I thought you could just use that
image to be a linkwhich would then be ignored by browsers that dont support
style sheets.
Obviously this does not.

Thankyou.
Post by Adrienne Boswell
Gazing into my crystal ball I observed "John Swan"
Post by John Swan
Hello.
I have created a website which does not seem to validate correctly. I
am only getting one error but to rectify this issue would result in
part of the site not working.
Basically I have a div which is nested inside a link. When the
validator parses this it throws an error, having tried different
combinations that does not work. Please check out the other pages on
the site to see what I mean (any opinions would be appreciated :) )
I know there is a easy fix which would be to include the image in the
<a> but that would defeat the point of style sheets and make mobile
users of limited browsers download a big image that would take time
and look even worse.
Please check out www.integrated-dev-sol.co.uk/index.html for more info
http://validator.w3.org
and enter the above url.
Why would you nest a div inside of a link - DIV is a block level element,
A is inline and cannot contain block level elements.
If you want A to show as blocklevel, the use CSS to do so.
@media screen {
img.bigimg {display:inline}
}
@media handheld {
img.bigimg {display:none}
}
<a href="page.html"><img src="bigimg.jpg" class="bigimg" alt="Large
image" height="500" width="500"></a>
--
Adrienne Boswell at Home
Arbpen Web Site Design Services
http://www.cavalcade-of-coding.info
Please respond to the group so others can share
Loading...