如何检测显示尺寸

时间:2015-09-07 08:30:48

标签: php

我有一个PHP脚本,我使用语言选择器的32px标志图标。如何检测小显示器以使用24px文件夹。 这是我的代码:

<img id="lang" src="./images/flags/32/en.png" />
<img id="lang" src="./images/flags/32/de.png" />
<img id="lang" src="./images/flags/32/en.png" />

2 个答案:

答案 0 :(得分:0)

尝试寻找这样的想法:

http://scottjehl.github.io/picturefill/

PHP无法检测显示尺寸。

答案 1 :(得分:0)

您可以使用Bootstrap实现媒体查询,例如:

.visible-xs-* Phones (<768px) Visible and Hidden for Desktop (≥1200px)
.visible-lg-* Phones (<768px) Hidden and Visible for Desktop (≥1200px)

查看更多here

相关问题