屬性 值 Min/Max 描述color integer yes 每種色彩的字節數color-index integer yes 色彩表中的色彩數device-ASPect-ratio integer/integer yes 寬高比例device-height length yes 設備屏幕的輸出高度device-width length yes 設備屏幕的輸出寬度grid integer no 是否是基於格柵的設備height length yes 渲染界面的高度monoChrome integer yes 單色幀緩沖器中每像素字節resolution resolution yes 分辨率scan no tv媒體類型的掃描方式width length yes 渲染界面的寬度orIEntation Portrait/landscape no 橫屏或豎屏
height min-height max-heightdevice-width min-device-width max-device-widthdevice-height min-device-height max-device-heightaspect-ratio min-aspect-ratio max-aspect-ratiodevice-aspect-ratio min-device-aspect-ratio max-device-ASPect-ratiocolor min-color max-colorcolor-index min-color-index max-color-indexMonochrome min-monochrome max-monoChromeResolution min-resolution max-resolution
and - 結合多個媒體查詢not - 排除某種制定的媒體類型only - 用來定某種特定的媒體類型
<link rel="stylesheet" media="all" href="style.CSS" /><link rel="stylesheet" media="screen and (min-width:980px)" href="desktop.css" /><link rel="stylesheet" media="screen and (min-width:768px) and (max-width:980px)" href="pad.css" /><link rel="stylesheet" media="screen and (min-width:480) and (max-width: 768px)" href="phone.css" /><link rel="stylesheet" media="screen and (max-width:320px)" href="small.CSS" />
@media screen and (min-width: 980px) { //CSS code}@screen and (min-width:768px) and (max-width:980px) { //css code}@screen and (min-width:480) and (max-width: 768px) { //css code}@screen and (max-width:320px) { //CSS code}@media screen and (max-device-width: 480px) { //max-device-width等於480px}@media screen and (device-aspect-ratio: 16/9), screen and (device-ASPect-ratio: 16/10) { //設備寬高比}@media all and (orientation:portrait) { //豎屏}@media all and (orIEntation:landscape) { //橫屏}
http://archive.plugins.jquery.com/project/MediaQuerIEs
本博客縮放即可看到效果