gpt4 book ai didi

css - 浏览器无法正确呈现字体,抗锯齿问题

转载 作者:行者123 更新时间:2023-11-28 12:47:37 53 4
gpt4 key购买 nike

我在浏览器上渲染字体时遇到了一些严重的抗锯齿问题,当我在烟花中设计时,一切看起来都很酷,但现在当我将它们用作 html/text 并在浏览器中查看它们时,它们来了在我测试的所有主要浏览器中都非常锯齿和丑陋。我在这里使用两种字体,较浅的一种是 'Segoe UI Light',较粗的一种是 Roboto Slab:

enter image description here

我在互联网和 SO 上搜索,发现了一些旨在解决这个问题的技巧,但没有一个对我有用,你可以在我的 CSS 中看到它们

<link href='http://fonts.googleapis.com/css?family=Roboto+Slab:400,700' rel='stylesheet' type='text/css'>

在 .CSS 中

body {
background-position: right;
background-position: top;
background-repeat: no-repeat;
font-family: 'Segoe UI Light', 'Century Gothic', Verdana, Arial, Helvetica, sans-serif;
font-size: 14px;
margin: 0;
padding: 0;
font-weight: normal;
-webkit-font-smoothing: antialiased;
font-smooth: always;
text-shadow: #eee 0px 1px 1px;
-webkit-text-stroke: 1px;
-webkit-font-smoothing: subpixel-antialiased;
}

nav ul {
margin: 0px;
padding: 0px;
width: 100%;
font-family: 'Roboto Slab','Segoe UI Light', 'Century Gothic', Verdana, Arial, Helvetica, sans-serif;
font-size: 19px;
text-align: center;
list-style-type: square;
}

nav li {
color: #FFF;
display: block;
float: left;
height: 36px;
text-transform: uppercase;
width: 200px;
margin: 15px 0 0 0;
}

最佳答案

文本阴影可能有帮助 text-shadow: #333 0px 0px 1px;

也试试 -webkit-text-stroke: 1px rgba(0,0,0,0.1)

关于css - 浏览器无法正确呈现字体,抗锯齿问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17258888/

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