我正在尝试在 fluidLayouts.css 文件中为流体布局设置图像宽度和高度,为此我正在通过 Dreamweaver cc 构建一个 RWD 网站。
现在图像宽度已取(以百分比表示),我如何设置适合移动设备、标签页和桌面的图像高度?我的意思是我应该以像素或百分比设置高度,以便适合移动设备、标签页和桌面中的任何图像吗?
等待回复,谢谢。
最佳答案
尝试以下标准设备的媒体查询 -
/* Smartphones (portrait and landscape) ----------- */
@media only screen and (min-device-width : 320px) and (max-device-width : 480px) { /* Styles */ }
/* Smartphones (landscape) ----------- */
@media only screen and (min-width : 321px) { /* Styles */ }
/* Smartphones (portrait) ----------- */
@media only screen and (max-width : 320px) { /* Styles */ }
/* iPads (portrait and landscape) ----------- */
@media only screen and (min-device-width : 768px) and (max-device-width : 1024px) { /* Styles */ }
/* iPads (landscape) ----------- */
@media only screen and (min-device-width : 768px) and (max-device-width : 1024px) and (orientation : landscape) { /* Styles */ }
/* iPads (portrait) ----------- */
@media only screen and (min-device-width : 768px) and (max-device-width : 1024px) and (orientation : portrait) { /* Styles */ }
/* Desktops and laptops ----------- */
@media only screen and (min-width : 1224px) { /* Styles */ }
/* Large screens ----------- */
@media only screen and (min-width : 1824px) { /* Styles */ }
/* iPhone 4 ----------- */
@media only screen and (-webkit-min-device-pixel-ratio : 1.5), only screen and (min-device-pixel-ratio : 1.5) { /* Styles */ }
您可以在其中根据设备编写您的 css 代码。
关于css - 在 dreamweaver cc 中编辑 fluidLayouts.css 用于图像宽度和高度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27685671/