>### 1.背景
~~~
背景顏色:background-color
背景圖片: background-image: url("images/icon1.png");
背景重復:background-repeat
背景位置:background-position: x y
//第一個參數表示離x軸的距離,y表示離y軸的距離
//簡寫
background: color image repeat position
背景吸附:background-attachment:fixed | scroll
background-size
//指定背景圖片大小。
background-size: x y;
//x表示寬度,y表示高度
background-size:cover;
此時會保持圖像的縱橫比并將圖像縮放成將完全覆蓋背景定位區域的最小大小。
相當于background-size:100% 100%;
背景的簡寫
background:color image repeat position
background: red url("images/icon1.png") no-repeat center center;
- html-css
- 第一節 外部樣式表
- 第二節 元素選擇器
- 第三章 盒子模型
- 第四章 html標簽的分類
- 第五章 css選擇器
- 第六章 權重
- 第七章 css基本樣式
- 第一節 背景
- 第二節 文本
- 第三節 字體
- 第四節 鏈接
- 第五節 列表(針對ul)
- 第六節 邊框
- 第七節 簡單表格
- 第八節 nvvm
- 第九節 跨越列的表格
- 第十節 跨越行的表格
- 第十一節 有間隔的表格
- 第十二節 opacity透明度
- 第八章 css樣式的繼承
- 進階教程
- 1.flex教程
- flex補充1
- flex補充2
- 2.grid布局
- css
- 第一節 box-sizing
- 第二節 float
- 第三節 position
- 第四節 導航欄
- iconfont的使用
- 第五節 搜索功能的實現