链接垂直对齐,高度100%

时间:2011-06-15 06:43:12

标签: html css hyperlink alignment vertical-alignment

如何在http://beta.ovoweb.net/a.php#的右侧红框中垂直居中“测试”文字? 链接的高度为100%,因此它填充整个td。现在,当我设置display:table-cell时,高度不再是100%。

2 个答案:

答案 0 :(得分:0)

将此添加到“icon”类

margin-top: auto

并删除

height:100%

答案 1 :(得分:0)

如果你想进入“display:table-cell”路线,我很确定你需要一个具有“display:table;”的父div。和“身高:100%;” (别忘了设置父宽度)