i wonder why the padding doesnt work to give space between border and image on ie7. it works fine on firefox though. did someone had any experience with this? if so, would you please share it. thank you <html> <head> <title></title> <style type="text/css" media="screen"> img.frontend_image { border: 1px solid #ccc; padding: 4px; } a:hover img.frontend_image { background: #ddd; border-color: #ddd; } </style> </head> <body> <a href="#"><img src="http://ams01.umicache.com/p/virb.com/crop_90x90/PageImage-123361-586874.jpg" class="frontend_image" alt=""></a> </body> </html> HTML:
I have come across this one, bugs inside the border and padding stuffs in IE7. Finally I redesign and avoid such troublesome parts!!!! It's a waste of time....
Use a proper and complete DOCTYPE declaration, then wrap your link around a DIV (since inline elements cannot be direct children of the BODY), and then set your anchor and image to block via CSS and assign widths and heights to them in your stylesheet.
it works when i desperately integrate it with my script template which have validated structure, especially DOCTYPE you've mentioned. thanks a lot <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> HTML: