自适应media_screen
根据屏幕分辨率进而修改CSS样式
使用方法
<div class="box"/>
<style>
@media screen and (max-width:600px){
.box{
height: 200px;
width: 200px;
background-color: blueviolet;
}
}
@media screen and (min-width:1200px){
.box{
height: 100px;
width: 300px;
background-color: pink;
}
}
@media screen and (min-width:600px) and (max-width:1200px){
.box{
height: 100px;
width: 100px;
background-color: lightskyblue;
}
}
</style>
注:本文可分享可转发,转发请注明出自bug源