嘿,我有以下的CSS代码:CSS vertical-align属性不起作用
.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),但它不工作,它只显示父元素顶端的文本。任何建议?谢谢。
为什么在所有属性值附近有引号? – Blender 2013-04-25 03:32:56
对不起,我只是做了一个我正在做的JavaScript课程的快速翻译,并忘记取下它们。 – Neo 2013-04-25 03:34:28