蚂蚁设计抽屉头固定

时间:2020-05-25 11:41:08

标签: css antd

我正在将我的React项目用于 ant design drawer ,我遇到了一些冲突,我尝试使用以下 CSS 命令position:fixed修复了抽屉标头,但没有出现,有人知道一些解决方案吗?

我的代码

.ant-drawer-header {
    position: relative;
    padding: 16px 24px;
    color: rgba(0, 0, 0, 0.65);
    background: #fff;
    position:fixed;
    border-bottom: 1px solid #e8e8e8;
    border-radius: 4px 4px 0 0;
}

谢谢

1 个答案:

答案 0 :(得分:1)

听听解决方法

.ant-drawer-header {
  position: absolute;
  padding: 16px 24px;
  z-index: 99999;
  color: rgba(0, 0, 0, 0.65);
  background: #fff;
  top: 0;
  left: 0;
  right: 0;
  border-bottom: 1px solid #e8e8e8;
  border-radius: 4px 4px 0 0;
}
.ant-drawer-body {
   padding: 24px;
   margin-top: 3rem;
   font-size: 14px;
   line-height: 1.5;
   word-wrap: break-word;
 }