【问题标题】:Ant design drawer header fixed蚂蚁设计抽屉头固定
【发布时间】:2020-05-25 11:41:08
【问题描述】:

我正在为 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;
}

谢谢

【问题讨论】:

  • 页眉默认是固定的,不需要添加固定位置。
  • @FatemehQasemkhani 你好,不,当我滚动我的抽屉标题时隐藏
  • 所以在沙箱或其他地方分享您的代码,并在您的 css 样式中添加相对和固定。为什么?如果要添加固定位置,也应该添加 100%

标签: css antd


【解决方案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;
 }

【讨论】:

    猜你喜欢
    • 2021-12-12
    • 1970-01-01
    • 2019-04-06
    • 2020-05-11
    • 1970-01-01
    • 1970-01-01
    • 2021-11-05
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多