css - 在 dreamweaver cc 中编辑 fluidLayouts.css 用于图像宽度和高度

标签 css responsive-design

我正在尝试在 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/

相关文章:

jquery - 将相同的随机类应用于指定的每个元素

css - 带有导航栏和垂直对齐轮播的 Twitter Bootstrap 布局?

css - 使 div 大小适合背景图像

html - 如何使容器 DIV 内的所有同级 DIV 具有相同的高度?

javascript - 获取响应式背景图像高度?

javascript - 使用 if 语句理解 jquery div 元素

javascript - 如何将文本显示到保留其限制的文本区域中?

css - 智能手机上的 HTML 菜单行为

javascript - Twitter 提要不显示所有内容,它只是一个链接

javascript - 整个页面上的响应图像