IMOこれらは最高のブレークポイントです:
@media (min-width:320px) { /* smartphones, portrait iPhone, portrait 480x320 phones (Android) */ }
@media (min-width:480px) { /* smartphones, Android phones, landscape iPhone */ }
@media (min-width:600px) { /* portrait tablets, portrait iPad, e-readers (Nook/Kindle), landscape 800x480 phones (Android) */ }
@media (min-width:801px) { /* tablet, landscape iPad, lo-res laptops ands desktops */ }
@media (min-width:1025px) { /* big landscape tablets, laptops, and desktops */ }
@media (min-width:1281px) { /* hi-res laptops and desktops */ }
編集:960グリッドでより良く機能するように改良されました:
@media (min-width:320px) { /* smartphones, iPhone, portrait 480x320 phones */ }
@media (min-width:481px) { /* portrait e-readers (Nook/Kindle), smaller tablets @ 600 or @ 640 wide. */ }
@media (min-width:641px) { /* portrait tablets, portrait iPad, landscape e-readers, landscape 800x480 or 854x480 phones */ }
@media (min-width:961px) { /* tablet, landscape iPad, lo-res laptops ands desktops */ }
@media (min-width:1025px) { /* big landscape tablets, laptops, and desktops */ }
@media (min-width:1281px) { /* hi-res laptops and desktops */ }
実際には、多くの設計者はピクセルをem
sに変換します。これは、主にem
sの方がズームが優れているためです。標準ズーム1em === 16px
では、ピクセルを乗算してs1em/16px
を取得しますem
。たとえば、320px === 20em
。
コメントに応えて、min-width
は「モバイルファースト」デザインの標準です。最初は最小の画面用にデザインし、次に増え続けるメディアクエリを追加して、ますます大きな画面に進んでいきます。
min-
、、またはそれらの組み合わせを好むかどうかに関係なく、max-
複数のルールが同じ要素に一致する場合、後のルールが前のルールをオーバーライドすることに注意して、ルールの順序を認識してください。