0

wordpress のヘッダー php に、両方のビューポートを追加できますか。

<meta name="viewport" content="width=device-width" /> 

<meta name="viewport" content="width=1024" />

x ピクセル未満のモバイル デバイスでない限り、代わりにeverythingを使用してディスプレイを表示できるようにしたいと考えています。viewport width 1024width=device-width

これは可能ですか?

ありがとう

4

2 に答える 2

1

良いプラグインを使用すると、次のようになります。

<meta name="viewport" content="width=<?php echo  (is_mobile()) ? "device-width" : "width=1024" ?>" />
于 2013-03-11T13:19:33.027 に答える
0

次のコードを試すことができます

/* #### Mobile Phones Portrait #### */
@media screen and (max-device-width: 480px) and (orientation: portrait){
/* some CSS here */
}

/* #### Mobile Phones Landscape #### */
@media screen and (max-device-width: 640px) and (orientation: landscape){
/* some CSS here */
}

/* #### Mobile Phones Portrait or Landscape #### */
@media screen and (max-device-width: 640px){
/* some CSS here */
}

/* #### iPhone 4+ Portrait or Landscape #### */
@media screen and (max-device-width: 480px) and (-webkit-min-device-pixel-ratio: 2){
/* some CSS here */
}

/* #### Tablets Portrait or Landscape #### */
@media screen and (min-device-width: 768px) and (max-device-width: 1024px){
/* some CSS here */
}

/* #### Desktops #### */
@media screen and (min-width: 1024px){
/* some CSS here */
}
于 2013-03-11T13:20:02.840 に答える