<asp:HyperLink Target="_blank" ID="img5" Height="90px" Width="966px" runat="server"></asp:HyperLink>
我想控制这个图片的高度和宽度,怎么弄?

解决方案 »

  1.   

    不是可以了,属性那里
    代码也可以的 img5.Width, Height
      

  2.   

    这样你还不如直接用IMG 外面套A标签
    或者把A标签的背景改成图片
    <a href=""><img id="aa" src="a.jpg" /></a>
      

  3.   

    用hyperlink或者a标签都可以
    里面放<img></img>,设置img的width和height
      

  4.   

    HyperLink只连接图片地址,用image控制
    var  flag=false;  
    function  DrawImage(ImgD){  
         var  image=new  Image();  
         image.src=ImgD.src;  
         if(image.width>0  &&  image.height>0){  
           flag=true;  
           if(image.width/image.height>=  140/120){  
             if(image.width>140){      
             ImgD.width=140;  
             ImgD.height=(image.height*140)/image.width;  
             }else{  
             ImgD.width=image.width;      
             ImgD.height=image.height;  
             }  
             }  
           else{  
             if(image.height>120){      
             ImgD.height=120;  
             ImgD.width=(image.width*120)/image.height;            
             }else{  
             ImgD.width=image.width;      
             ImgD.height=image.height;  
             }  
             }  
           }  
    }      
    image中onload="javascript:DrawImage(this)">