【问题标题】:Resizing image height and width according to device screen根据设备屏幕调整图像高度和宽度
【发布时间】:2014-01-03 06:48:14
【问题描述】:

如何在不同设备上全屏显示我的图像,即根据设备显示自动调整图像?

我尝试了“宽度:设备宽度”选项,但没有成功。有什么帮助吗?

【问题讨论】:

    标签: android css dojo ibm-mobilefirst


    【解决方案1】:

    我找到了解决方案。我在我的 css 中遵循“@media 查询”概念,它为我解决了问题。

    【讨论】:

      【解决方案2】:

      检查这个 CSS 是否对你的代码有帮助!!

         html, body {
              width:100%; /* this is a must */
              height:100%; /* this is a must */
              margin:0;
              padding:0;
          }
          img {
              width:100%; /* this will depend on parent containers width */
              height:auto;
          }
      

      see demo here重新调整浏览器的宽度和高度以查看变化

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2014-08-24
        • 2017-03-10
        • 2023-03-03
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多