Click here to Skip to main content
15,885,366 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have this code in my html page.
HTML
<a href="#"><div id="icon_in"></div></a>

W3 validator show me this error.
document type does not allow element "div" here; missing one of "object", "applet", "map", "iframe", "button", "ins", "del" start-tag
I try to fixed it using span tag, then error gone but not showing span background image.
How can I fixed if?
Posted
Updated 29-Nov-13 23:28pm
v4

1 solution

Maybe try to include your <a> tag inside your <div> tag, instead of the contrary?
 
Share this answer
 
v2
Comments
sazzad37 30-Nov-13 5:33am    
No, I did not do this. Thank you for your response.
phil.o 30-Nov-13 5:34am    
Do you mean:
- you did not try?
- you do not want to try?
- you tried but it does not work?
sazzad37 30-Nov-13 5:43am    
My div tag has a background image and it change on hover. All I need is to use this div background image as a link. How can i do this without any error?
phil.o 30-Nov-13 5:48am    
Simple: just read my answer and apply it. See:
<div><img><a></a></img></div>

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900