font-size
font-style
italic 사용font-weight
.text {
font-size:80rem;
font-style:italic; /*강조하기 위해 사용*/
font-weight: bold;
}
font-family
""로 감싸줌.text {
font-family: Arial, sans-serif;
}
line-height
line-height를 설정해주지 않으면 폰트에 따라 달라짐.text {
line-height: 24px;
/*단위 표현으로도 가능*/
}
font-style font-weight/line-height font-size font-family 순서대로 작성.text {
font: [font-size], [font-family], [그 외는 선택];
}
⚠ shorthand 사용 시 주의사항
아래처럼 작성하면 기본 값으로 돌아감
shorthand의 작성 순서를 지켜서 작성
(두 속성의 순서가 바뀌면 괜찮음🙆♀️).text { font-size: 20px; font: ~~[font-size],~~ [font-family], [그 외는 선택]; }
letter-spacing
normalword-spacing
normal.text {
letter-spacing: -1px;
word-spacing: 2px;
/*음수도 사용 가능*/
}
text-align
block 요소일 때만 적용 가능inline에 정렬하고 싶다면, 부모 block 요소에 추가해줘야함.text {
text-align: center;
}
text-indent
.text {
text-indent: 20px;
}
text-decoration (shorthand)
line : none, underline, overline, line-throughcolor : line colorstyle : solid, double, dotted, dashed, wavythickness : size.text {
text-decoration: line-through red 1px dotted;
}
break-all : 단어 하나하나마다 자름keep-all : 처음부터 끝까지 이어짐 (한 단어 취급)✔ 브라우저 여백
기본적으로body에margin이 들어있기 때문에body{margin: 0}해줘야 여백 없어짐
calc()
calc()로 계산할 수 있음width: calc(100% - 80px);
min()
width: min(100%, 80px);
max()
width: max(100%, 80px);