レスポンシブWebデザインとは

レスポンシブWebデザインとは、デバイスごとに複数のデザインを用意するのではなく、ブラウザーのウィンドウサイズに合わせてデザインをフレキシブルに調整されるようなCSSを作成することです。1つのhtmlで、デバイスごとに専用サイトを用意することなく、様々なデバイスに合わせて、CSSを切り替えて表示します。

メディア・クエリ(Media Queries)によるスタイル(CSS)の切り替え

たとえば、iPhoneのmobile Safariはディスプレイを320 x 480 ピクセルで認識するので、max-device-width を 480px で最適化されたiphone.cssを読み込むようにします。正確にはディスプレイの最大幅が480pxのデバイスで閲覧したら iphone.cssを読み込むようにします。

このように、横幅240px、320px、480px、768px、1024px別にCSSファイルを用意して、 メディア・クエリ(Media Queries)で自動的に切り替わるようにします。

メディア・クエリ(Media Queries)の例(千差万別)

  • @media ( max-width: 1000px ) and (min-width: 480px){
  • @media ( max-width: 1000px ) and (min-width: 540px){
  • @media ( max-width: 1000px ) and (min-width: 580px){
  • @media ( max-width: 1000px ){
  • @media ( max-width: 400px ){
  • @media ( max-width: 580px ){
  • @media ( max-width: 788px ){
  • @media ( max-width: 830px ) and (min-width: 580px){
  • @media ( max-width:35em ){
  • @media ( min-width : 768px ) {
  • @media ( min-width:35em ){
  • @media (max-width: 1000px) and (min-width: 480px){
  • @media (max-width: 1000px) and (min-width: 540px){
  • @media (max-width: 1000px) and (min-width: 580px) {
  • @media (max-width: 1000px) and (min-width: 620px){
  • @media (max-width: 1000px){
  • @media (max-width: 1024px) {
  • @media (max-width: 1160px) {
  • @media (max-width: 435px) and ( min-width: 380px ){
  • @media (max-width: 440px){
  • @media (max-width: 450px) {
  • @media (max-width: 480px) {
  • @media (max-width: 480px){
  • @media (max-width: 520px) {
  • @media (max-width: 540px){
  • @media (max-width: 580px){
  • @media (max-width: 619px){
  • @media (max-width: 620px) {
  • @media (max-width: 640px){
  • @media (max-width: 650px){
  • @media (max-width: 700px) {
  • @media (max-width: 767px) {
  • @media (max-width: 767px){
  • @media (max-width: 768px) {
  • @media (max-width: 768px) and (min-width: 480px){
  • @media (max-width: 770px){
  • @media (max-width: 780px) {
  • @media (max-width: 800px) {
  • @media (max-width: 870px) {
  • @media (max-width: 920px) {
  • @media (max-width: 955px) and (min-width: 651px){
  • @media (max-width: 979px) {
  • @media (max-width: 999px) {
  • @media (max-width:1024px) {
  • @media (max-width:1024px){
  • @media (max-width:320px) {
  • @media (max-width:350px){
  • @media (max-width:35em){
  • @media (max-width:479px) {
  • @media (max-width:480px) {
  • @media (max-width:480px){
  • @media (max-width:500px){
  • @media (max-width:640px) {
  • @media (max-width:640px){
  • @media (max-width:700px){
  • @media (max-width:767px){
  • @media (max-width:768px) {
  • @media (max-width:800px){
  • @media (max-width:979px){
  • @media (min-device-width: 768px) and (max-device-width: 1024px) {
  • @media (min-width: 0px) and (max-width: 480px){
  • @media (min-width: 0px) and (max-width: 550px){
  • @media (min-width: 0px) and (max-width: 999px){
  • @media (min-width: 1001px) {
  • @media (min-width: 1020px) and (max-width: 1200px){
  • @media (min-width: 1200px) {
  • @media (min-width: 1200px){
  • @media (min-width: 480px) {
  • @media (min-width: 481px) and (max-width: 888px){
  • @media (min-width: 768px) and (max-width: 979px) {
  • @media (min-width: 800px) and (max-width: 999px){
  • @media (min-width: 980px) {
  • @media (min-width:1280px){
  • @media (min-width:35em){
  • @media (min-width:55em){
  • @media (min-width:768px) and (max-width:979px){
  • @media (min-width:980px){
  • @media (-webkit-min-device-pixel-ratio: 1.5) {
  • @media (-webkit-min-device-pixel-ratio: 1.5) and (max-width: 480px) {
  • @media all and (max-width: 640px){
  • @media all and (max-width:310px){
  • @media all and (max-width:35em){
  • @media all and (min-width: 640px){
  • @media all and (min-width: 768px){
  • @media all and (min-width: 769px){
  • @media all and (min-width: 960px){
  • @media all and (min-width:28em){
  • @media all and (min-width:480px){
  • @media all and (-webkit-min-device-pixel-ratio: 1.25) {
  • @media handheld, all and (max-width:580px){
  • @media only all{
  • @media only screen (min-width: 2561px) {
  • @media only screen (min-width:10px) and (max-width:840px) {
  • @media screen and (min-width: 1024px) and (max-height:760px){
  • @media screen and (device-width:480px) {
  • @media screen and (device-width:540px) {
  • @media screen and (max-device-width: 1024px){
  • @media screen and (max-device-width: 480px) {
  • @media screen and (max-device-width: 480px){
  • @media screen and (max-height: 640px) {
  • @media screen and (max-height:650px){
  • @media screen and (max-width: 1000px) {
  • @media screen and (max-width: 1010px) {
  • @media screen and (max-width: 1018px) {
  • @media screen and (max-width: 1020px){
  • @media screen and (max-width: 1023px){
  • @media screen and (max-width: 1024px) {
  • @media screen and (max-width: 1024px){
  • @media screen and (max-width: 1030px) {
  • @media screen and (max-width: 1040px) {
  • @media screen and (max-width: 1050px) {
  • @media screen and (max-width: 1055px) {
  • @media screen and (max-width: 1060px) {
  • @media screen and (max-width: 1062px) {
  • @media screen and (max-width: 1072px) {
  • @media screen and (max-width: 1090px){
  • @media screen and (max-width: 1095px) {
  • @media screen and (max-width: 1100px) {
  • @media screen and (max-width: 1104px) {
  • @media screen and (max-width: 1106px) {
  • @media screen and (max-width: 1119px) {
  • @media screen and (max-width: 1120px) and (min-width: 900px) {
  • @media screen and (max-width: 1150px) {
  • @media screen and (max-width: 1195px) {
  • @media screen and (max-width: 1200px) {
  • @media screen and (max-width: 1235px) {
  • @media screen and (max-width: 1252px) {
  • @media screen and (max-width: 1260px) {
  • @media screen and (max-width: 1280px) {
  • @media screen and (max-width: 1392px) {
  • @media screen and (max-width: 1400px) {
  • @media screen and (max-width: 1600px) {
  • @media screen and (max-width: 230px) {
  • @media screen and (max-width: 320px) {
  • @media screen and (max-width: 320px){
  • @media screen and (max-width: 322px) {
  • @media screen and (max-width: 330px) {
  • @media screen and (max-width: 354px){
  • @media screen and (max-width: 380px) {
  • @media screen and (max-width: 400px) {
  • @media screen and (max-width: 421px) {
  • @media screen and (max-width: 423px) {
  • @media screen and (max-width: 440px) {
  • @media screen and (max-width: 450px) {
  • @media screen and (max-width: 479px) {
  • @media screen and (max-width: 480px) {
  • @media screen and (max-width: 480px), (max-device-width: 480px) {
  • @media screen and (max-width: 480px){
  • @media screen and (max-width: 500px) {
  • @media screen and (max-width: 501px) {
  • @media screen and (max-width: 520px) {
  • @media screen and (max-width: 540px){
  • @media screen and (max-width: 545px) {
  • @media screen and (max-width: 550px) {
  • @media screen and (max-width: 560px){
  • @media screen and (max-width: 568px) {
  • @media screen and (max-width: 590px) {
  • @media screen and (max-width: 599px) {
  • @media screen and (max-width: 600px) {
  • @media screen and (max-width: 600px), (max-device-width: 600px) {
  • @media screen and (max-width: 610px) {
  • @media screen and (max-width: 620px){
  • @media screen and (max-width: 640px) {
  • @media screen and (max-width: 647px) {
  • @media screen and (max-width: 650px) {
  • @media screen and (max-width: 650px){
  • @media screen and (max-width: 656px) {
  • @media screen and (max-width: 660px) {
  • @media screen and (max-width: 669px){
  • @media screen and (max-width: 670px){
  • @media screen and (max-width: 680px) {
  • @media screen and (max-width: 680px){
  • @media screen and (max-width: 690px){
  • @media screen and (max-width: 700px) {
  • @media screen and (max-width: 700px){
  • @media screen and (max-width: 719px) {
  • @media screen and (max-width: 720px) {
  • @media screen and (max-width: 720px){
  • @media screen and (max-width: 725px) {
  • @media screen and (max-width: 730px) {
  • @media screen and (max-width: 736px) {
  • @media screen and (max-width: 750px) {
  • @media screen and (max-width: 760px) {
  • @media screen and (max-width: 767px) {
  • @media screen and (max-width: 767px){
  • @media screen and (max-width: 768px) {
  • @media screen and (max-width: 768px), (max-device-width: 768px) {
  • @media screen and (max-width: 768px){
  • @media screen and (max-width: 780px){
  • @media screen and (max-width: 784px) {
  • @media screen and (max-width: 786px) {
  • @media screen and (max-width: 800px) {
  • @media screen and (max-width: 800px) and (orientation : landscape) {
  • @media screen and (max-width: 810px) {
  • @media screen and (max-width: 822px) {
  • @media screen and (max-width: 840px) {
  • @media screen and (max-width: 850px) {
  • @media screen and (max-width: 860px) {
  • @media screen and (max-width: 865px) {
  • @media screen and (max-width: 870px) {
  • @media screen and (max-width: 871px) {
  • @media screen and (max-width: 880px) {
  • @media screen and (max-width: 899px) {
  • @media screen and (max-width: 900px) {
  • @media screen and (max-width: 900px){
  • @media screen and (max-width: 910px) {
  • @media screen and (max-width: 916px) {
  • @media screen and (max-width: 928px){
  • @media screen and (max-width: 935px) {
  • @media screen and (max-width: 940px) {
  • @media screen and (max-width: 949px) {
  • @media screen and (max-width: 950px) {
  • @media screen and (max-width: 950px){
  • @media screen and (max-width: 956px) {
  • @media screen and (max-width: 959px) {
  • @media screen and (max-width: 960px) {
  • @media screen and (max-width: 960px), (max-device-width: 960px) {
  • @media screen and (max-width: 970px) {
  • @media screen and (max-width: 980px) {
  • @media screen and (max-width: 985px) {
  • @media screen and (max-width: 987px) {
  • @media screen and (max-width: 995px) {
  • @media screen and (max-width: 996px) {
  • @media screen and (max-width:1016px) {
  • @media screen and (max-width:1024px) {
  • @media screen and (max-width:1024px) and (min-width:641px){
  • @media screen and (max-width:1024px){
  • @media screen and (max-width:1040px) {
  • @media screen and (max-width:1050px) {
  • @media screen and (max-width:1060px) and (min-width:641px){
  • @media screen and (max-width:1119px){
  • @media screen and (max-width:1140px){
  • @media screen and (max-width:1200px) {
  • @media screen and (max-width:1200px){
  • @media screen and (max-width:1260px) {
  • @media screen and (max-width:1279px){
  • @media screen and (max-width:1280px) {
  • @media screen and (max-width:1350px) {
  • @media screen and (max-width:1420px){
  • @media screen and (max-width:1440px) {
  • @media screen and (max-width:1500px) {
  • @media screen and (max-width:1740px){
  • @media screen and (max-width:300px) {
  • @media screen and (max-width:319px){
  • @media screen and (max-width:320px) {
  • @media screen and (max-width:320px){
  • @media screen and (max-width:327px){
  • @media screen and (max-width:363px){
  • @media screen and (max-width:370px){
  • @media screen and (max-width:400px) {
  • @media screen and (max-width:419px){
  • @media screen and (max-width:420px){
  • @media screen and (max-width:449px){
  • @media screen and (max-width:450px) {
  • @media screen and (max-width:479px){
  • @media screen and (max-width:480px) {
  • @media screen and (max-width:480px){
  • @media screen and (max-width:481px){
  • @media screen and (max-width:484px){
  • @media screen and (max-width:485px){
  • @media screen and (max-width:490px){
  • @media screen and (max-width:501px){
  • @media screen and (max-width:510px){
  • @media screen and (max-width:520px){
  • @media screen and (max-width:539px){
  • @media screen and (max-width:540px){
  • @media screen and (max-width:549px){
  • @media screen and (max-width:568px){
  • @media screen and (max-width:570px){
  • @media screen and (max-width:572px){
  • @media screen and (max-width:595px){
  • @media screen and (max-width:599px){
  • @media screen and (max-width:600px) {
  • @media screen and (max-width:600px){
  • @media screen and (max-width:625px){
  • @media screen and (max-width:639px) {
  • @media screen and (max-width:639px){
  • @media screen and (max-width:640px) {
  • @media screen and (max-width:640px){
  • @media screen and (max-width:658px){
  • @media screen and (max-width:698px){
  • @media screen and (max-width:710px) {
  • @media screen and (max-width:720px) {
  • @media screen and (max-width:720px) and (orientation:portrait) {
  • @media screen and (max-width:730px) {
  • @media screen and (max-width:740px){
  • @media screen and (max-width:750px) {
  • @media screen and (max-width:767px) {
  • @media screen and (max-width:767px){
  • @media screen and (max-width:768px) {
  • @media screen and (max-width:768px){
  • @media screen and (max-width:780px) and (min-width:641px){
  • @media screen and (max-width:812px){
  • @media screen and (max-width:819px){
  • @media screen and (max-width:848px){
  • @media screen and (max-width:860px){
  • @media screen and (max-width:879px){
  • @media screen and (max-width:880px) and (min-width:641px){
  • @media screen and (max-width:900px) {
  • @media screen and (max-width:900px){
  • @media screen and (max-width:940px) and (min-width:700px){
  • @media screen and (max-width:944px){
  • @media screen and (max-width:949px){
  • @media screen and (max-width:959px){
  • @media screen and (max-width:960px) {
  • @media screen and (max-width:980px) {
  • @media screen and (max-width:980px) and (min-width:641px){
  • @media screen and (max-width:980px){
  • @media screen and (max-width:981px){
  • @media screen and (min-width : 1024px) {
  • @media screen and (min-width : 320px) {
  • @media screen and (min-width : 768px) {
  • @media screen and (min-width : 768px){
  • @media screen and (min-width: 0px) and (max-width: 480px) {
  • @media screen and (min-width: 1001px) {
  • @media screen and (min-width: 1001px) and (max-width: 1100px) {
  • @media screen and (min-width: 1024px) {
  • @media screen and (min-width: 1024px) and (max-width: 1125px){
  • @media screen and (min-width: 1024px){
  • @media screen and (min-width: 1025px){
  • @media screen and (min-width: 10px) {
  • @media screen and (min-width: 1101px) {
  • @media screen and (min-width: 1121px) and (max-width: 1329px) {
  • @media screen and (min-width: 1126px) and (max-width: 1200px){
  • @media screen and (min-width: 1151px) {
  • @media screen and (min-width: 1151px) and (max-width: 1600px) {
  • @media screen and (min-width: 1200px) {
  • @media screen and (min-width: 1330px) {
  • @media screen and (min-width: 1561px) {
  • @media screen and (min-width: 1601px) and (max-width: 2200px) {
  • @media screen and (min-width: 2201px) {
  • @media screen and (min-width: 320px) and (max-width: 480px) {
  • @media screen and (min-width: 355px) and (max-width: 495px){
  • @media screen and (min-width: 480px) {
  • @media screen and (min-width: 480px) and (max-width:640px) {
  • @media screen and (min-width: 481px) {
  • @media screen and (min-width: 481px) and (max-width: 1020px){
  • @media screen and (min-width: 481px) and (max-width: 514px){
  • @media screen and (min-width: 481px) and (max-width: 520px){
  • @media screen and (min-width: 481px) and (max-width: 600px){
  • @media screen and (min-width: 481px) and (max-width: 620px){
  • @media screen and (min-width: 481px) and (max-width: 720px) {
  • @media screen and (min-width: 481px) and (max-width: 820px) {
  • @media screen and (min-width: 496px) and (max-width: 594px){
  • @media screen and (min-width: 515px) and (max-width: 680px){
  • @media screen and (min-width: 521px) and (max-width: 680px){
  • @media screen and (min-width: 521px) and (max-width: 920px){
  • @media screen and (min-width: 568px) {
  • @media screen and (min-width: 569px) and (max-width: 960px) {
  • @media screen and (min-width: 580px) {
  • @media screen and (min-width: 595px) and (max-width: 620px){
  • @media screen and (min-width: 601px) and (max-width: 840px){
  • @media screen and (min-width: 621px) and (max-width: 724px){
  • @media screen and (min-width: 621px) and (max-width: 970px){
  • @media screen and (min-width: 640px) and (max-width:768px) {
  • @media screen and (min-width: 641px) {
  • @media screen and (min-width: 641px) and (max-device-width: 768px) {
  • @media screen and (min-width: 641px) and (max-width:1024px) {
  • @media screen and (min-width: 641px) and (max-width:768px) {
  • @media screen and (min-width: 641px){
  • @media screen and (min-width: 650px) and (max-width: 960px) {
  • @media screen and (min-width: 650px)and (max-width: 960px) {
  • @media screen and (min-width: 670px) and (max-width: 870px){
  • @media screen and (min-width: 670px) and (max-width: 900px){
  • @media screen and (min-width: 681px) {
  • @media screen and (min-width: 681px) and (max-width: 829px){
  • @media screen and (min-width: 681px) and (max-width: 849px){
  • @media screen and (min-width: 691px) and (max-width: 930px){
  • @media screen and (min-width: 701px){
  • @media screen and (min-width: 721px) {
  • @media screen and (min-width: 721px) and (max-width: 1024px) {
  • @media screen and (min-width: 721px) and (max-width: 980px) {
  • @media screen and (min-width: 725px) and (max-width: 767px){
  • @media screen and (min-width: 751px) {
  • @media screen and (min-width: 767px) {
  • @media screen and (min-width: 768px) {
  • @media screen and (min-width: 768px) and (max-width: 1023px) {
  • @media screen and (min-width: 768px) and (max-width: 928px){
  • @media screen and (min-width: 768px) and (max-width: 950px) {
  • @media screen and (min-width: 769px){
  • @media screen and (min-width: 781px) and (max-width: 950px){
  • @media screen and (min-width: 800px) and (orientation: landscape){
  • @media screen and (min-width: 800px) and (orientation: portrait){
  • @media screen and (min-width: 841px) and (max-width: 1030px){
  • @media screen and (min-width: 900px) {
  • @media screen and (min-width: 901px) and (max-width: 1100px){
  • @media screen and (min-width: 929px) and (max-width: 1023px){
  • @media screen and (min-width: 929px) and (max-width: 1024px){
  • @media screen and (min-width: 960px) {
  • @media screen and (min-width: 961px) {
  • @media screen and (min-width: 961px){
  • @media screen and (min-width: 981px) {
  • @media screen and (min-width: 981px) and (max-width: 1150px) {
  • @media screen and (min-width:1024px) {
  • @media screen and (min-width:1024px){
  • @media screen and (min-width:1080px){
  • @media screen and (min-width:1281px){
  • @media screen and (min-width:1399px){
  • @media screen and (min-width:20em){
  • @media screen and (min-width:30em){
  • @media screen and (min-width:320px) and (max-width:595px){
  • @media screen and (min-width:33.75em){
  • @media screen and (min-width:40em){
  • @media screen and (min-width:42.5em){
  • @media screen and (min-width:50em){
  • @media screen and (min-width:53.5em){
  • @media screen and (min-width:540px){
  • @media screen and (min-width:560px){
  • @media screen and (min-width:595px) and (max-width:980px){
  • @media screen and (min-width:600px){
  • @media screen and (min-width:60em){
  • @media screen and (min-width:64.0625em){
  • @media screen and (min-width:64.0625em)and (min-height:768px){
  • @media screen and (min-width:640px){
  • @media screen and (min-width:641px) {
  • @media screen and (min-width:680px){
  • @media screen and (min-width:700px){
  • @media screen and (min-width:70em){
  • @media screen and (min-width:70em)and (min-height:768px){
  • @media screen and (min-width:70em)and (min-height:900px){
  • @media screen and (min-width:721px) {
  • @media screen and (min-width:813px){
  • @media screen and (min-width:900px){
  • @media screen and (min-width:940px){
  • @media screen and (min-width:980px) and (max-width:1200px){
  • @media screen and (orientation: landscape) {
  • @media screen and (orientation: portrait) {
  • @media screen and (orientation:landscape){
  • @media screen and (orientation:portrait){
  • @media screen and (-webkit-min-device-pixel-ratio: 0) {
  • @media screen and (-webkit-min-device-pixel-ratio: 2) and (min-width: 0px) and (max-width: 480px) {
  • @media screen and (-webkit-min-device-pixel-ratio: 2) and (min-width: 0px) and (max-width: 999px){
  • @media screen and (-webkit-min-device-pixel-ratio:0){
  • @media screen and (width: 480px) {
  • @media screen and (width:320px) {
  • @media(max-width:480px){
  • @media(max-width:767px){
  • @media(min-width: 0px) and (max-width: 480px){
  • @media(min-width: 0px) and (max-width: 999px) {
  • @media(min-width: 0px) and (max-width: 999px){
  • @media(min-width: 481px) and (max-width: 999px){
  • @media(min-width: 551px) and (max-width: 600px){
  • @media(min-width: 601px) and (max-width:960px){
  • @media(min-width:0)and (max-width:899px){
  • @media(min-width:1025px){
  • @media(min-width:1025px)and (min-height:900px){
  • @media(min-width:1140px){
  • @media(min-width:280px){
  • @media(min-width:400px){
  • @media(min-width:540px){
  • @media(min-width:64.0625em)and (min-height:900px){
  • @media(min-width:768px) and (max-width:1040px){
  • @media(min-width:900px){

©kokyaku.jp 2012-