同一字体 不同样式 在css中引入方式

<style>
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 300;
font-display: swap;
src: url('./fonts/Roboto-Light.ttf');
}

@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 400;
font-display: swap;
src: url('./fonts/Roboto-Regular.ttf');
}
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 500;
font-display: swap;
src: url('./fonts/Roboto-Medium.ttf');
}
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: bold;
font-display: swap;
src: url('./fonts/Roboto-Bold.ttf');
}

@font-face {
font-family: 'Futura PT';
font-display: block;
src: url('./fonts/FuturaPT-Demi.ttf');
}
body {
font-family: 'Roboto';
}
.t1 {
font-weight: 300;
}
.t2 {
font-weight: 400;
}
.t3 {
font-weight: 900;
}
.t4 {
font-weight: bold;
}
.t5 {
font-family: 'Futura PT';
}
posted @ 2022-02-18 15:13  fanly_hh  阅读(180)  评论(0)    收藏  举报