我是靠谱客的博主 坚定大侠,这篇文章主要介绍css 类似抽屉,现在分享给大家,希望可以做个参考。

背景;angular6+ng-alain

要点:不是通过隐藏dom,而是通过调整样式,来遮盖部分样式

html:

复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<div nz-row nzGutter="24"> <div nz-col nzXs="24" nzMd="24"> <div class="showPanel " [class.hide]="isCollapsed"> <nz-button-group > <button nz-button>Cancel</button> <button nz-button nzType="primary">OK</button> </nz-button-group> <div class="fixicons" (click)="toggleCollapsed()" > <i class="anticon" [class.anticon-caret-up]="isCollapsed" [class.anticon-caret-down]="!isCollapsed"> </i> </div> </div> </div> </div>

css:

复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
.showPanel{ position: absolute; /*margin-left: 389px;*/ left: 25%; /*text-align: center;*/ height: 100px; width: 800px; /*display: block;*/ border-right: 2px solid lightskyblue; border-bottom: 2px solid lightskyblue; border-left: 2px solid lightskyblue; } .fixicons { position: absolute; width: 40px; background: white; /*bottom: -122px;*/ bottom: -22px; left: 48%; margin-left: -20px; /*cursor: pointer;*/ border-bottom-left-radius: 18px; border-bottom-right-radius: 18px; box-shadow: 2px 5px 7px #888; text-align: center; } .hide{ bottom: -12px; }

ts:

复制代码
1
2
3
4
5
isCollapsed = false; toggleCollapsed(): void { this.isCollapsed = !this.isCollapsed; }

效果图

 

最后

以上就是坚定大侠最近收集整理的关于css 类似抽屉的全部内容,更多相关css内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(80)

评论列表共有 0 条评论

立即
投稿
返回
顶部