【发布时间】:2014-01-27 09:24:00
【问题描述】:
我有这个div:
HTML:
<div draggable="false" id="coffe">Free coffee</div>
CSS:
div {
position: absolute;
overflow: auto;
text-align: left;
font-size: 23px;
color: rgb(26, 66, 108);
font-family: roboto, Helvetica;
font-style: normal;
font-weight: bold;
-webkit-transition: none;
transition: none;
left: 0px;
top: 67.125px;
width: 1029.25px;
height: 234.93749999999997px;
opacity: 1;
background: grey;
}
我需要将其内容垂直居中,即“免费咖啡”。
我该怎么做?我尝试使用vertical-align: middle;,但它不起作用。
这是小提琴文件:http://jsfiddle.net/2Mb39/
【问题讨论】: