doc: update css.md.

This commit is contained in:
jaywcjlove 2022-11-08 11:35:17 +08:00
parent 04dd94d6f8
commit 06c6229cac
2 changed files with 22 additions and 1 deletions

View File

@ -1396,6 +1396,27 @@ body {
}
```
### 吸附滚动
<!--rehype:wrap-class=row-span-2-->
```css {5,12}
.container {
height: 250px;
overflow-x: scroll;
display: flex;
scroll-snap-type: x mandatory;
column-gap: 10px;
}
.child {
flex: 0 0 66%;
width: 250px;
background-color: #663399;
scroll-snap-align: center;
}
```
可用于 `轮播图` 效果,[效果预览](https://codesandbox.io/embed/pensive-leftpad-w9p8rk?fontsize=14&hidenavigation=1&theme=dark)
### 类似 contenteditable 的样式
```css

View File

@ -89,7 +89,7 @@ Golang 基本类型
s1 := "Hello" + "World"
s2 := `A "raw" string literal
can include line breaks.`
// 输出11
// 输出10
fmt.Println(len(s1))
// 输出Hello
fmt.Println(string(s1[0:5]))