首页  >  文章  >  web前端  >  web中媒体查询的方法

web中媒体查询的方法

一个新手
一个新手原创
2017-10-05 15:32:501769浏览

定位布局

媒体查询的代码:

<!DOCTYPE html><html> <head> <meta charset="UTF-8"> <title></title> <style> .a {
    border: 1px solid #000000;
    width: 100px;
    height: 100px;
    background-color: #000000;
}
@media only screen and (min-width: 300px) and (max-width: 640px) {
    .a {
    background-color: red;
}
} @media only screen and (min-width: 700px) {
    .a {
    background-color: green;
}
} @media only screen and (max-width:200px ) {
    .a {
    background-color: blue;
}
} </style> </head> <body> <p class="a"></p> </body></html>

以上是web中媒体查询的方法 的详细内容。更多信息请关注PHP中文网其他相关文章!

声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn