티스토리 뷰

HTML CSS JS

CSS) line-height

Programmers 2021. 8. 20. 08:26
반응형

1) line-height
줄 높이(줄 간격) 지정, 행간

이거 아님
이거 맞음

속성 값

의미 기본값
normal 브라우저의 기본 정의를 사용(1~1.4) normal
숫자 요소 자체 글꼴 크기의 배수로 지정  
단위 px, em, cm등 단위로 지정  
% 요소 자체 글꼴 크기의 비율로 지정  

※ 보통은 1.4 ~ 1.7정도의 line-height로 사용한다.

숫자사용▷ line-height: 2;

코드

html

<div>Helping Small Businesses Succeed The primary goal of certification is to level 
the playing field by providing certified firms a fair opportunity to compete for government
contracts regardless of owner ethnicity, gender, disability, or firm size.</div>

css

div {
  line-height: 2;
  font-size: 30px;
}

결과

 

font-size가 30px이고, line-height가 2이면 px값으로 따져서 font-size의 2배니깐 60이 된다. 즉 아래의 코드와 동일하다.

css

div {
  line-height: 60px;
  font-size: 30px;
}

 

 

반응형

'HTML CSS JS' 카테고리의 다른 글

CSS) 문자(Text) 관련 속성, color  (0) 2021.08.23
CSS) font-family  (0) 2021.08.23
CSS) font-size  (0) 2021.08.20
CSS) font-weight  (0) 2021.08.20
CSS) opacity opacity: 1; opacity: .75; opacity: .5; opacity: 0; display: none;  (0) 2021.08.19
댓글
공지사항