【发布时间】:2014-01-03 06:48:14
【问题描述】:
如何在不同设备上全屏显示我的图像,即根据设备显示自动调整图像?
我尝试了“宽度:设备宽度”选项,但没有成功。有什么帮助吗?
【问题讨论】:
标签: android css dojo ibm-mobilefirst
如何在不同设备上全屏显示我的图像,即根据设备显示自动调整图像?
我尝试了“宽度:设备宽度”选项,但没有成功。有什么帮助吗?
【问题讨论】:
标签: android css dojo ibm-mobilefirst
我找到了解决方案。我在我的 css 中遵循“@media 查询”概念,它为我解决了问题。
【讨论】:
检查这个 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(重新调整浏览器的宽度和高度以查看变化)
【讨论】: