CSS垂直和水平对齐div内部的跨度?

时间:2022-11-03 13:14:10

Please look at this jsfiddle: http://jsfiddle.net/xMAKq/20/

请看这个jsfiddle:http://jsfiddle.net/xMAKq/20/

How could I center the left column text to be centered like this:

我怎样才能将左列文本居中,如下所示:

CSS垂直和水平对齐div内部的跨度?

3 个解决方案

#1


5  

You would like to use text-align: center and vertical-align: middle css properties.

您想使用text-align:center和vertical-align:middle css属性。

See example

#2


3  

You can try with display and table values (table-row and table-cell) and then use vertical-align: middle, as in http://jsfiddle.net/frozenkoi/xMAKq/22/

您可以尝试使用display和table值(table-row和table-cell),然后使用vertical-align:middle,如http://jsfiddle.net/frozenkoi/xMAKq/22/

#3


0  

add text-align center... see http://jsfiddle.net/jEKsK/1/

添加文本对齐中心...请参阅http://jsfiddle.net/jEKsK/1/

#1


5  

You would like to use text-align: center and vertical-align: middle css properties.

您想使用text-align:center和vertical-align:middle css属性。

See example

#2


3  

You can try with display and table values (table-row and table-cell) and then use vertical-align: middle, as in http://jsfiddle.net/frozenkoi/xMAKq/22/

您可以尝试使用display和table值(table-row和table-cell),然后使用vertical-align:middle,如http://jsfiddle.net/frozenkoi/xMAKq/22/

#3


0  

add text-align center... see http://jsfiddle.net/jEKsK/1/

添加文本对齐中心...请参阅http://jsfiddle.net/jEKsK/1/