我应该为哪些分辨率编码?

时间:2013-05-15 10:22:34

标签: html css web-applications screen-resolution

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

我正在制作一个包含no-scrolloverflow: hidden;的网页因此我需要调整每个desktop resolutionmobile resolution的网页,所以我只需要一个列表,如果可能请

2 个答案:

答案 0 :(得分:2)

您可以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

答案 1 :(得分:0)

通过@media查询使用响应式CSS ..像这样

@media only screen and (max-width: 320px) {
    .container {width: 100%;}   
    .dropdown {height:35px;}
    .dropdown p {line-height:35px;}
    .header {height:40px; background:url(images/logoplastik.png) no-repeat 10px 90% left center ;   }
}

@media only screen and (min-width: 321px) and (max-width: 480px) {
    .container {width: 100%; }
    .dropdown {height:35px;}
    .dropdown p {line-height:35px;}
    .header {height:40px; padding-left:10px;}
}