CSS

CSS 외부 폰트 적용

김태웜 ㅣ 2021. 1. 21. 11:32

반응형
<style type="text/css">
@font-face {
    font-family: 'Maplestory';
    src: url('./font/Light.woff') format('truetype');
	font-weight: normal;
    font-style: normal;
}
</style>

스타일 태그안에 font-face를 사용하여 넣는다

font-family: "적용시킬때 사용할 이름";

src: url('폰트파일 위치 경로') foramt('타입형식);

font-weight: 두꺼운정도;

font-style: 스타일;

 

경로는 현재 파일이있는 위치에서부터 ./다음폴더명/파일명 이런식으로 했음

이상하게 시킨대로했는데 안되길래 다운받은 파일은 ttf파일이었는데

그파일을 woff파일로 변환시켜서 다시 적용했더니 됐음 (왜문제였는지는잘모르겠음)

반응형