嘿,我有以下CSS代码:
.parent
{
position : 'absolute';
top : '50px';
left : '50px';
width : '400px';
height : '160px';
padding : '10px';
border : '2px solid';
border-color : '#444444';
background-color : '#FF0000';
text-align : 'center';
/*display : inline; tried this also and didn't work.*/
}
.child
{
color : '#123456';
font-size : '16px';
font-family : 'Arial';
vertical-align : 'middle';
}
我只是想把孩子的内容放在父div的中心(x和y),但它不起作用,它只显示父元素顶部的文本.有什么建议吗?谢谢.