如果屏幕分辨率结束,则显示图像? [英] Show image if screen resolution is over?

查看:87
本文介绍了如果屏幕分辨率结束,则显示图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一种仅在屏幕分辨率高于x,x为网页时显示图像的方法。它目前只使用HTML / CSS的网站,虽然我对这些想法持开放态度。

I am looking for a way to show an image ONLY if screen resolution is higher than x,x for a webpage. The website it currently using only HTML/CSS, although I am open to ideas.

如果有可能,我们将非常感谢任何帮助。

If this is possible any help would be greatly appreciated.

谢谢。

推荐答案

为此,我们通常使用媒体查询

// Set Defaults for Small displays like Mobile
.img { 
    display:none; // your image class or can be img tag
} 

// Desktop and landscape tablets more than 960 px
@media (min-width: 960px){
   .img { display: block; margin: 0 auto;} // your image class or can be img tag
}

如果你有兴趣,只需看看这个教程

if you're interested just have a look at this tutorial

这篇关于如果屏幕分辨率结束,则显示图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆