如何使图像充当不带javascript的链接

|| 拥有文本和图像的链接的最佳解决方案是什么,并且该解决方案仍将在XHTML 1.0 STRICT下经过w3c验证?和没有JavaScript。     
已邀请:
使用CSS,无需使用javascript。
<a href=\"#\" class=\"image\">Hello</a>

<style>
    .image {
       padding-left: 20px; // width of image
       background: url(image.jpg) no-repeat scroll left center;
       height: 20px; // height of image
       line-height: 20px; //height of image
       // other rules that you need  
    }
</style>
    
我将把链接(锚)包裹在div周围,并给div一个带有CSS的背景图像。在DIV中添加一个包含文本的跨度,并在跨度上设置\“ margin \”样式以使文本与口味对齐。 本质上,测试TEXT看起来会叠加在图像上。 希望这可以帮助。     
您是否尝试过通过http://htmldog.com/阅读?这通常说明如何使用基本HTML
<a href=\"link.html\">
  TEXT HERE
  <img src=\"imageurl.jpg\" width=\"100\" height=\"100\" alt=\"TEXT HERE FOR ALT\" />
</a>
    

要回复问题请先登录注册