菜鳥教程給出的媒體查詢尺寸
阿新 • • 發佈:2018-12-15
<h2>響應式判斷</h2>
<p class="example">操作瀏覽器視窗,檢視效果。</p>
.example { padding: 20px; color: white; } /* Extra small devices (phones, 600px and down) */ @media only screen and (max-width: 600px) { .example {background: red;} } /* Small devices (portrait tablets and large phones, 600px and up) */ @media only screen and (min-width: 600px) { .example {background: green;} } /* Medium devices (landscape tablets, 768px and up) */ @media only screen and (min-width: 768px) { .example {background: blue;} } /* Large devices (laptops/desktops, 992px and up) */ @media only screen and (min-width: 992px) { .example {background: orange;} } /* Extra large devices (large laptops and desktops, 1200px and up) */ @media only screen and (min-width: 1200px) { .example {background: pink;} }