높이가 퍼센트 인 div의 텍스트를 가운데 정렬하고 싶습니다. 내가 사용하고있는 코드는 이것이다.텍스트 가운데 세로 정렬이 작동하지 않습니다.
CSS-
.div{
position: fixed;
left: 0px;
border-radius: 10px;
height: 6%;
width: 20%;
transform: translate(-10px,0px);
-ms-transform: translate(-10px,0px);
-webkit-transform: translate(-10px,0px);
-o-transform: translate(-10px,0px);
-moz-transform: translate(-10px,0px);
z-index: 10
}
.div span {
text-align: center;
font: 20px/100% Arial, Helvetica, sans-serif;
text-decoration: none;
color: #fff;
display: block;
vertical-align: middle;
}
, HTML
<div class="div"><span>This is some text.</span></div>
이 밤은 작동. 도와주세요.
아주 많이이 나를 위해 일한 주셔서 감사합니다! – sdnr1