Responsive设计——不一样设备的分辨率设置

下面咱们一块儿来看看CSS3 Meida Queries在标准设备上的运用,你们能够把这些样式加到你的样式文件中,或者单首创建一个名为“responsive.css”文件,并在相应的条件中写上你的样式,让他适合你的设计需求:

1.1024px显屏css

@media screen and (max-width : 1024px) {                    
/* 样式写在这里 */          
}     

2.800px显屏html

@media screen and (max-width : 800px) {              
/* 样式写在这里 */          
}     

3.640px显屏git

@media screen and (max-width : 640px) {              
/* 样式写在这*/            
}     

4.iPad横板显屏github

@media screen and (max-device-width: 1024px) and (orientation: landscape) {              
/* 样式写在这 */            
}     

5.iPad竖板显屏bootstrap

@media screen and (max-device-width: 768px) and (orientation: portrait) {         
/* 样式写在这 */            
}     

6.iPhone 和 Smartphonesspa

@media screen and (min-device-width: 320px) and (min-device-width: 480px) {              
/* 样式写在这 */            
}     

如今有关于这方面的运用也是至关的成熟,twitter的Bootstrap第二版本中就加上了这方面的运用。你们能够对比一下:设计

@media (max-width: 480px) { ... }              code

@media (max-width: 768px) { ... }              htm

@media (min-width: 768px) and (max-width: 980px) { ... }      ip

 @media (min-width: 1200px) { .. }

相关文章
相关标签/搜索