溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

CSS3的Media Queries實例分析

發布時間:2022-03-08 10:53:13 來源:億速云 閱讀:181 作者:iii 欄目:web開發

這篇“CSS3的Media Queries實例分析”文章的知識點大部分人都不太理解,所以小編給大家總結了以下內容,內容詳細,步驟清晰,具有一定的借鑒價值,希望大家閱讀完這篇文章能有所收獲,下面我們一起來看看這篇“CSS3的Media Queries實例分析”文章吧。

一、Media Queries 支持的屬性

屬性 值 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) { //橫屏}

以上就是關于“CSS3的Media Queries實例分析”這篇文章的內容,相信大家都有了一定的了解,希望小編分享的內容對大家有幫助,若想了解更多相關的知識內容,請關注億速云行業資訊頻道。

向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

亚洲午夜精品一区二区_中文无码日韩欧免_久久香蕉精品视频_欧美主播一区二区三区美女