div 안에 100px만큼 텍스트를 세로 정렬하려고합니다. 문제는 글꼴 크기를 더 크게 설정하면 선 높이를 고려하지 않는다는 것입니다.큰 글꼴 크기의이 텍스트가 줄 높이를 고려하지 않는 이유는 무엇입니까?
다른 글꼴 크기 (12px)로 다른 테스트를하는 것이 효과적입니다.
어떻게 수정해야하며 왜 이런 일이 발생합니까?
더 큰 글꼴 크기 : http://jsfiddle.net/2sLNy/1/
작은 글꼴 크기 : http://jsfiddle.net/2sLNy/2/
더 큰 글꼴 크기 코드 :
div{
position: relative;
width: 100px;
height: 100px;
background-color: #DDD;
-webkit-border-radius: 50%;
-moz-border-radius: 50%;
border-radius: 50%;
text-align: center;
line-height: 100px;
}
div:hover:before{
opacity: 1;
}
div:before{
opacity: 0;
position: absolute;
width: 100px;
height: 100px;
display: block;
text-align: center;
font-size: 12px;
color: #FFF;
content: " + ";
background-color: rgba(0, 0, 0, 0.5);
z-index: 1;
-webkit-border-radius: 50%;
-moz-border-radius: 50%;
border-radius: 50%;
line-height: 100px;
}
감사합니다!