DIV 标签下的图片在电脑端显示,手机端不显示的方法

技术流1 3,670阅读模式

DIV 标签下的图片在电脑端显示,手机端不显示的方法

先用CSS写好一个Class,代码如下:文章源自原紫番博客-https://www.yuanzifan.com/54308.html

<style>
@media screen and (max-width: 1000px) { 
  .none{
        display:none; 
       }
}
</style>

再插入一个div,调用刚刚写好的这个CSS:文章源自原紫番博客-https://www.yuanzifan.com/54308.html

<div class="none">
<img src="图片地址"></img>
</div>

代码的含义为:当屏幕宽度低于1000px,则图片不显示。文章源自原紫番博客-https://www.yuanzifan.com/54308.html

文章源自原紫番博客-https://www.yuanzifan.com/54308.html 文章源自原紫番博客-https://www.yuanzifan.com/54308.html

 
    • repostone 1

      非技术的路过。

    发表评论

    匿名网友
    :?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:
    确定

    拖动滑块以完成验证