在Figma中,我有一个文本设计,它显示了以下代码:
/* Create Account */
position: absolute;
width: 343px;
height: 142px;
left: 575px;
top: 272px;
font-family: Montserrat;
font-style: normal;
font-weight: bold;
font-size: 30px;
line-height: 37px;
display: flex;
align-items: center;
text-align: center;
color: rgba(255, 255, 255, 0.92);
但是,当我在html中使用以下代码时(文本的字体与Figma所示相同,则文本在html/css中的字体与在figma中的字体不同,如我附加的两个图像所示(请忽略不同的背景):
<!DOCTYPE html>
<html lang="en">
<head>
</head>
<body style="margin: 0 auto;text-align:center;background: #141E30; /* fallback for old browsers */ background: -webkit-linear-gradient(to bottom, #243B55, #141E30); /* Chrome 10-25, Safari 5.1-6 */ background: linear-gradient(to bottom, #243B55, #141E30); /* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */;">
<p style="font-family: Montserrat; font-style: normal; font-weight: bold; color: rgba(255, 255, 255, 0.92);font-size: 30px;">Create Account</p>
</body>
</html>
有人知道为什么我不能在html/css中重新创建完全相同的字体外观吗?
图设计:
HTML/CSS:
发布于 2020-06-24 16:01:45
添加HTML head:
<link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;600;700;800&display=swap" rel="stylesheet">
添加Css:
font-family: 'Montserrat', sans-serif;
https://stackoverflow.com/questions/62550186
复制相似问题