Text getting cut off, because of line-height conflict with vertical-align:top

回眸只為那壹抹淺笑 提交于 2019-12-12 17:07:07

问题


I have a table with a form that contains a submit button formatted like text, inside a table.

All table rows in general are set to vertical-align: top

If I don't apply an line-height to the formatted text, its bottom part will get cut off, noticeable with letters like p, q etc. (bottom part in fiddle)

If I do apply it a line-height, it will be aligned below other regular text elements in other cells. (bottom part in fiddle)

Here is the fiddle.

CSS:

.text-alt {
    overflow: visible;
    margin: 0;
    padding: 0;
    border: 0;
    color: #4D4D4D;
    background: 0 0;
    font: inherit;
    text-decoration: none;
    cursor: pointer;
    -moz-user-select: text;
    //line-height: normal;
}
tr:first-child td {
    vertical-align: top
}

tr:first-child+tr td {
    vertical-align: top;
    background-color: #fff
}

For Full CSS / HTML please refer to fiddle.

来源:https://stackoverflow.com/questions/35544133/text-getting-cut-off-because-of-line-height-conflict-with-vertical-aligntop

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!