## 條件覆蓋
最終后面設置的樣式會將前面的樣式進行覆蓋掉.前提是順序不能錯.
```
body {
background-color: red;
}
@media screen and (min-width: 768px) {
body {
background-color: green;
}
}
@media screen and (min-width: 992px) {
body {
background-color: blue;
}
}
@media screen and (min-width: 1200px) {
body {
background-color: pink;
}
}
```
## 注意
如果是判斷min-width應該從小往大寫,如果判斷max-width應該從大往小寫. bootstrap 就是判斷最小值.
## 補充
```
<link rel="stylesheet" href="./css/mobile.css">
//當符合下面的條件的時候調用下面的樣式
<link rel="stylesheet" media="screen and (min-width:768px) and (max-width:1200px)" href="./css/pc.css">
```
## not
```
body {
background-color: black;
}
//不在下面的范圍內取下面的值
@media not screen and (min-width: 768px) and (max-width: 960px){
body {
background-color: pink;
}
}
```
- HTML
- 瀏覽器內核
- Web標準
- HTML標簽關系
- 路徑
- 表單
- datalist
- fieldset
- H5新增input
- 列表
- 表格
- 網站優化三大標簽
- CSS
- 規則
- 命名規則
- 偽類選擇器
- 塊級元素和行內元素區別
- 權重
- 盒子模型
- 浮動
- 清除浮動
- 版心和布局流程
- 定位
- 元素的顯示和隱藏
- overflow溢出
- CSS用戶界面樣式
- 垂直對齊
- 取出圖片地測空白縫隙
- 溢出的文字隱藏
- 精靈技術
- 字體圖標
- 滑動門
- before和after偽元素
- 2D
- 過度效果
- translate
- scale
- rotate
- skew
- 3D
- 左手法則
- rotateX,Y,Z旋轉
- perspective
- translateZ
- translate3d
- backface-visibility
- 動畫(animation)
- 概述
- 伸縮布局
- BFC
- 優雅降級和漸進增強
- 背景漸變
- CSS統一驗證工具
- CSS壓縮工具
- 移動web基礎知識
- 基礎
- 像素密度
- 設備獨立像素
- css像素
- 2倍圖
- 調試
- 視口的概念及設置
- PC端的視口
- 移動端的視口
- 移動端頁面正常展示的解決方案
- 移動端viewport設置
- 移動站點和瀏覽器的說明
- 響應式開發
- 基礎
- 媒體查詢
- 媒體查詢條件判斷
- 媒體功能
- 使用媒體查詢設置頁面布局
- bootstrap