【问题标题】:Plush frame not aligning毛绒框架未对齐
【发布时间】:2018-01-27 02:56:00
【问题描述】:

我正在研究3 frames in this codepen,其中框架类似于结构基础形状。我正在测试 3 个元素 span button input 上的每一个,这些元素通过 preset classes 重置。使用densebasic 框架的元素垂直对齐,而plush 框架垂直未对齐。 plush 有什么不同导致对齐差异?我需要添加什么来规范化对齐方式?

.frame-dense {
  border-image: none;
  border-radius: var(--radii-medium);
  border-style: solid;
  border-width: 1px;
  display: inline-block;
  min-height: 28px;
  padding: 3px 11px;
}

.frame-basic {
  border-image: none;
  border-radius: var(--radii-medium);
  border-style: solid;
  border-width: 1px;
  display: inline-block;
  min-height: 36px;
  padding: 7px 15px;
}

.frame-plush {
  border-image: none;
  border-radius: var(--radii-medium);
  border-style: solid;
  border-width: 1px;
  display: inline-block;
  min-height: 48px;
  padding: 11px 23px;
}

【问题讨论】:

    标签: css alignment


    【解决方案1】:

    尝试将.frame-plush 的顶部/底部填充更改为 13px 而不是 11px,如下所示:

    .frame-plush {
      border-image: none;
      border-radius: var(--radii-medium);
      border-style: solid;
      border-width: 1px;
      display: inline-block;
      min-height: 48px;
      padding: 13px 23px;
    }
    

    【讨论】:

    • 感谢这让我意识到min-height 太低了。如果我只是删除 min-height 也会对齐它们!我添加了一个空元素测试,让我意识到我似乎确实需要 min-height 来处理这种情况。跟进stackoverflow.com/q/48469414/770127
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-10-25
    相关资源
    最近更新 更多