gpt4 book ai didi

css - 自定义字体无法在手机上连接

转载 作者:太空宇宙 更新时间:2023-11-04 00:58:19 25 4
gpt4 key购买 nike

我在我的网页上使用自定义字体,它在桌面版本上运行良好,但在移动设备上,字体没有改变。我想我一定是在 font-face 属性上做错了什么。这是 CSS 文件。有什么想法吗?

html, body {
height: 100%;
width: 100%;
}

body {
background-image: url("/images/Portrait.jpg");
font-family: Occupied,Arial,sans-seriff;
}


@font-face {
font-family:"Occupied";
src: url("/public/font/Occupied.eot?") format("eot"),
url("/public/font/Occupied.woff") format("woff"),
url("/public/font/Occupied.otf") format("otf"),
url("/public/font/Occupied.woff2") format("woff2"),
url("/public/font/Occupied.ttf") format("truetype"),
url("/public/font/Occupied.svg#Occupied") format("svg");
font-weight:normal;
font-style:normal;
}

最佳答案

先尝试添加@font-face

@font-face {
font-family:"Occupied";
src: url("/public/font/Occupied.eot?") format("eot"),
url("/public/font/Occupied.woff") format("woff"),
url("/public/font/Occupied.otf") format("otf"),
url("/public/font/Occupied.woff2") format("woff2"),
url("/public/font/Occupied.ttf") format("truetype"),
url("/public/font/Occupied.svg#Occupied") format("svg");
font-weight:normal;
font-style:normal;
}

html, body {
height: 100%;
width: 100%;
}

body {
background-image: url("/images/Portrait.jpg");
font-family: Occupied,Arial,sans-seriff;
}

关于css - 自定义字体无法在手机上连接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54054596/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com