方法1:根据不同分辨率使用不同css文件
例如
方法2:同一css文件中,根据不同分辨率使用不同样式
.first {background-color: white;}.second {background-color: black;}@media screen and (max-width: 800px) { /*当屏幕尺寸小于800px时,应用下面的CSS样式*/ .first {background-color: green;} .second {background-color: skyblue;}}@media screen and (max-width: 480px) { /*当屏幕尺寸小于480px时,应用下面的CSS样式*/ .first {background-color: yellow;} .second {background-color: red;}}
参考:
http://www.hdhcms.com/cssref/css3-pr-mediaquery.html
查看更多关于css3@media实现响应式布局_html/css_WEB-ITnose的详细内容...
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://haodehen.cn/did111164