- position: static;
- position: relative;
- position: fixed;
- position: absolute;
- position: sticky;
fixed 很常被使用在 header、footer、右側滑動廣告
fixed 作為 header使用時,內容區塊往往要搭配 padding-top、 margin-top、 top,避面內容被刊頭遮擋住,用在 footer 時也會產生相同的問題。
| 功能 | 用來儲存值,方便重複利用 |
|---|---|
| 表示方式 | $自己取的變數名 |
| 資料型態 | Numbers、Strings、Booleans、null 值(視為空值),甚至可以使用 Lists、Maps。
|
//gray字體顏色+背景
@for $i from 1 through 9 { //從 1 到 9 共執行 9 次。
.color-gray#{$i}00 {
color: rgba( 0,0,0,($i) /10 );
}
.bg-gray#{$i}00 {
background-color: rgba( 0,0,0,($i) /10 );
}
|
| 會的 | 不會的 |
|---|---|
|
除了左邊的,其他程式全都不會 |
| SCSS | SASS | |
|---|---|---|
| 共同優點 |
|
|
| 共同缺點 |
|
|
| 適合對象 | 設計師 | 工程師 |
| 優點 |
|
|
| 缺點 |
|
|
| 支援 | 變數、@mixin、@extend | 變數、@mixin、@extend |
| 引入@minxin | 前面寫@include | 前面加「+」就可以載入mixin |
| 寫Mixin | 須用{}將內容包住 | 無 |
| 寫巢狀繼承 | 須在繼承的父元素裡面撰寫class與class的css | |