html - 我应该为哪些决议编写代码?

标签 html css web-applications screen-resolution

<分区>

我需要一份我应该编码的桌面和移动分辨率列表。

我正在制作一个带有no-scrolloverflow: hidden; 的页面,所以我需要为每个桌面分辨率移动分辨率,所以如果可能的话我只需要一个列表。

最佳答案

可以引用CSS Tricks对于 Media Queries for Standard Devices .这包括纵向和横向布局。

/* 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 */
}

也有许多可用的在线代码段:

  1. > Common @media queries
  2. > Media queries for common device breakpoints
  3. > Responsive Web Design: Layouts and Media Queries
  4. > Common CSS Media Queries Break Points

关于html - 我应该为哪些决议编写代码?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16562525/

上一篇:css - divs 通过 CSS 媒体查询显示属性变化

下一篇:CSS 菜单无法在 IE 中正确呈现

相关文章:

html - Bootstrap 表格边框在 Firefox 中无法正确显示

css - 单击外部按钮扩展搜索栏

html - 此 html 是否无效,受格式影响的 span 元素

ruby-on-rails - 如何从特定的 Ruby on Rails 页面中删除应用程序布局?

jquery - 开发时同时使用Dojo、extJS和Jquery有什么缺点?

php - 我只想删除 via 和邮件标题中写的额外内容

javascript - 单选按钮状态在鼠标松开或单击时未更新

javascript - 用Jquery限制div的上下移动

css - 你如何将div float 到左边?

javascript - 如何使用当前登录的 Windows Active Directory 用户登录 Web 应用程序?