首先html head之间加入:
<meta
content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"
name="viewport">
 
需要写两个样式
@media(max-width:669px){//当屏幕最大669时,执行下面css
.navigation-top{
display: none;
}
}
 
@media(min-width:669px){//当屏幕最小669时,执行下面
.phone-top{
display: none;
}
}
 
js:
//屏幕尺寸改变时触发
 window.onresize = function(){

 

}

屏幕分辨率的高:window.screen.height 

屏幕分辨率的宽:window.screen.width 

相关文章:

  • 2022-12-23
  • 2021-08-11
  • 2022-12-23
  • 2021-11-06
  • 2021-06-27
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-12
  • 2022-12-23
相关资源
相似解决方案