1.图片居中的问题还没有得到理想的答案,由于时间关系,暂时只能先用绝对定位实现。
2.接下来遇到的是rt问题。解决方案如下:(其中17、18行是关键。但同时也要注意,15、16行对a的宽高定义是必不可少的,和背景图片大小一致即可。)
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2 <html xmlns="http://www.w3.org/1999/xhtml">
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5 <title>CSS用背景图片替换超链接文字方法</title>
6 <style type="text/css">
7 .list{
8 display:inline;
9 float:left;
10 }
11 .list a{
12 margin:0px;
13 padding:0px;
14 background:url(image/button.png) no-repeat;
15 width:60px;
16 height:30px;
17 display:block;
18 cursor:hand;
19 }
20 .list a:hover{
21 background:url(image/button_hover.png) no-repeat;
22 }
23 </style>
24 </head>
25 <body>
26 <div class="list"><a href="###" target="_blank"></a></div>
27 </body>
28 </html>
                    
                
                
            
        
浙公网安备 33010602011771号