텍스트의 크기, 굵기와 글꼴 설정
텍스트 크기와 굵기 설정
font-size와 font-weight를 이용하면 텍스트의 크기를 바꿀 수 있으며
font-size를 사용하면 다양한 단위를 이용하여 글자 크기를 바꿀 수 있고, font-weight를 이용하면 두께를 바꿀 수 있다.
(px, inch, centi등도 입력 가능)
예시
.roboto-regular {
font-family: "Roboto", serif;
font-weight: 400;
font-style: normal;
}
글꼴 설정
글꼴은 외부 페이지에서 로드할 수도 있으며, ‘href’속성을 이용하여 링크를 입력하면 된다.
예를 들어,
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap" rel="stylesheet">
와 같이 표현할 수 있다.
728x90
'CSS' 카테고리의 다른 글
| 상속(Inheritance) 개념과 계단식 상속(Cascading logic) (0) | 2024.12.13 |
|---|---|
| 이미지 스타일의 변경 (1) | 2024.12.10 |
| 가상 선택자(Pseudo Selectors) (0) | 2024.12.07 |
| ID 선택자(ID Selectors) (0) | 2024.12.05 |
| CSS코드 저장, 병합 (1) | 2024.12.04 |