[CSS] web font - google font


<!DOCTYPE html>
<html>
    <head>
        <link rel="preconnect" href="https://fonts.gstatic.com">
        <link href="https://fonts.googleapis.com/css2?family=Nanum+Pen+Script&family=Noto+Sans+KR:wght@300&display=swap" rel="stylesheet">
        <style>
            #font1{
                font-family: 'Nanum Pen Script', cursive;
                font-size: 2rem;
            }
        </style>
    </head>
    <body>
        <p id="font1">안녕하세요. Hello</p>
        <p>안녕하세요. hello</p>
    </body>
</html>

https://fonts.google.com/
上記サイトに登録し、必要なフォントselect this styleを選択します.


linkをheadに追加し、CSS rules to specify familiesコードを使用してフォントを追加すればいいです.