Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Steps步骤条 ant-steps-head-inner 中文字未垂直居中 #3760

Closed
wph95 opened this issue Nov 8, 2016 · 2 comments
Closed

[BUG] Steps步骤条 ant-steps-head-inner 中文字未垂直居中 #3760

wph95 opened this issue Nov 8, 2016 · 2 comments
Assignees
Labels
🐛 Bug Ant Design Team had proved that this is a bug.

Comments

@wph95
Copy link
Contributor

wph95 commented Nov 8, 2016

发生问题的环境是:

  • antd 版本: 2.2.1
  • 操作系统及其版本: Macintosh; Intel Mac OS X 10_11_5
  • 浏览器及其版本:Chrome/54.0.2840.71

您做了什么?请提供尽可能详细的重现步骤。

访问 https://ant.design/components/steps/ 即可看到 尤其是代码演示中的 迷你版的 step 2.
2 明显靠上,未能垂直居中

您期待的结果是:

ant-steps-head-inner 中的内容应该是垂直居中

可重现的在线演示

https://ant.design/components/steps/

问题分析:

.ant-steps .ant-steps-head-inner>.ant-steps-icon {
    line-height: 1;
    top: -1.5px;
    color: #2db7f5;
    position: relative;
}

.ant-steps.ant-steps-small .ant-steps-head-inner {
    border: 1px solid #ccc;
    width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    border-radius: 18px;
    font-size: 12px;
    margin-right: 10px;
}

猜测该问题之前已经有发现,试图使用 top: -1.5px 矫正。 然而未起到效果。
参考 http://stackoverflow.com/questions/11829393/why-the-spans-line-height-is-useless

按以下办法可以解决问题:

  1. ant-steps-head-inner 中的 span => div
  2. line-height = ant-steps-head的 height + 2px (ant-steps-head的border-width 为1)
@wph95 wph95 changed the title [BUG] Steps步骤条 ant-steps-head-inner 中文字未垂直对其 [BUG] Steps步骤条 ant-steps-head-inner 中文字未垂直对齐 Nov 8, 2016
@wph95 wph95 changed the title [BUG] Steps步骤条 ant-steps-head-inner 中文字未垂直对齐 [BUG] Steps步骤条 ant-steps-head-inner 中文字未垂直居中 Nov 8, 2016
@afc163 afc163 self-assigned this Nov 8, 2016
@afc163 afc163 added the 🐛 Bug Ant Design Team had proved that this is a bug. label Nov 8, 2016
@afc163 afc163 closed this as completed in 6bf9ac4 Nov 8, 2016
@afc163
Copy link
Member

afc163 commented Nov 8, 2016

感谢你的反馈和细致分析,对我们很有帮助~ 👍

afc163 added a commit that referenced this issue Nov 8, 2016
@lock
Copy link

lock bot commented May 3, 2018

This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread.

@lock lock bot locked as resolved and limited conversation to collaborators May 3, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🐛 Bug Ant Design Team had proved that this is a bug.
Projects
None yet
Development

No branches or pull requests

2 participants