使用@media媒体查询响应式兼容判断
@media(条件){……}
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
| 彩色屏幕和最小宽度1000下 @media only screen and (min-width:1000px){#wrap{}}
@media (device-height:480px) and (-webkit-min-device-pixel-ratio:2){ .topbox{padding-top:50px;} } @media (device-height:568px) and (-webkit-min-device-pixel-ratio:2){ .topbox{padding-top:70px;} } @media (device-height:667px) and (-webkit-min-device-pixel-ratio:2){ .topbox{padding-top:100px;} } @media (device-height:736px) and (-webkit-min-device-pixel-ratio:2){ .topbox{padding-top:130px;} }
html { font-size: 10px; } @media (max-width: 767px) { html { font-size: 8.5px; } } @media (min-width: 768px) { html { font-size: 9px; } } @media (min-width: 992px) { html { font-size: 9.5px; } } @media (min-width: 1200px) { html { font-size: 10px; } }
|