【问题标题】:Image's stretching in Safari and Chrome图片在 Safari 和 Chrome 中的拉伸
【发布时间】:2012-06-14 22:41:33
【问题描述】:

我正在展示很多广告图片。在Firefox中它工作正常。但在 safari 和 chrome 中,它显示了一些拉伸图像。此处附有一个示例。有人知道如何解决这个问题吗?

我的代码是这样的,

   <style>  
    #globalpsa {
    width:100%;
    height:100%;
    border:3px double #fff;
    margin:2% auto;
    }
   #globalpsa input[type="image"] {
    width:100%;
    height:100%;
    }
    </style>

    <div id="globalpsa">
    <a> 
     <input type="image" src="/images/advert_images/ban2.jpg" alt="globalpsa"    
     name="globalpsa"/>          
     </a>
     </div>

谢谢,

【问题讨论】:

    标签: html css firefox google-chrome safari


    【解决方案1】:

    删除高度并查看图像。默认情况下,图像是成比例的。

    <style>  
     #globalpsa {
      width:100%;
      /* height:100%; remove this */
      border:3px double #fff;
      margin:2% auto;
     }
     #globalpsa input[type="image"] {
      width:100%;
      /* height:100%; remove this */
     }
    </style>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-01-07
      • 2019-12-22
      • 1970-01-01
      • 2020-07-20
      • 1970-01-01
      • 1970-01-01
      • 2021-02-12
      相关资源
      最近更新 更多