Vertical align all(!) elements in TD?

前端 未结 11 1227
鱼传尺愫
鱼传尺愫 2021-01-31 14:28

I have a simple table with 1 TD with vertical-align:middle;. This TD contains an Image :



        
11条回答
  •  你的背包
    2021-01-31 14:38

    Is this what you mean? http://jsfiddle.net/JFVNq/

    The reason is spans are treated as inline so you need to make them block.

    CSS for the span:

    td.vert span
    {
        vertical-align: middle;
        display: block;
    }
    

提交回复
热议问题