如何使用 CSS 中的自定义字体来阻止这种丑陋的字体平滑?
我的页面有一些按钮,使用自定义字体,使用 CSS 和 Font Squirrel 生成器。
当字体的颜色为黑色时,它们显示良好...
但是,当我将颜色更改为其他颜色时,文本似乎进行了平滑处理,使字符相互渗透,通常使字符看起来太厚...
我已经尝试过 font-smooth
属性和其他一些东西,但一直无法让它工作......
我不认为它太相关,但 CSS这些按钮是...
color: #FFFFFF;
display: block;
padding: 1em 0.3em;
position: relative;
text-decoration: none;
z-index: 10;
font-family: BebasNeueRegular,Arial,Sans-Serif;
font-size: 22px;
list-style: none outside none;
text-align: center;
text-transform: uppercase;
背景是一个单独的元素。
如何使白色文本显示为黑色文本?
(可能很难区分两者之间的区别,但我的老板坚持认为它就在那里。)
I have some buttons my page using a custom font face using the CSS and files generated by the Font Squirrel generator.
When the font's colour is black, they display fine...
However, when I change the colour to something else, the text seems to have a smoothing that bleeds the characters into each other and generally makes the characters look too thick...
I've played around with font-smooth
property and a few other things, but have been unable to get it to work...
I don't think it's too relevant but the CSS for these buttons are...
color: #FFFFFF;
display: block;
padding: 1em 0.3em;
position: relative;
text-decoration: none;
z-index: 10;
font-family: BebasNeueRegular,Arial,Sans-Serif;
font-size: 22px;
list-style: none outside none;
text-align: center;
text-transform: uppercase;
The background is a separate element.
How can I get the white text to appear like the black text?
(It may be hard to tell the difference between the two, but my boss insists it is there.)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这对我有用:
This worked for me:
部分问题在于它不是一种制作特别精良的字体。我同意@thirtydot关于文本阴影的建议。 1px 黑底黑字阴影应该会使字体变细。无论如何,任何不支持文本阴影的浏览器都会以可怕的方式呈现字体。
Part of the problem is that it's not a particularly well-made font. I concur with @thirtydot's suggestion of text-shadow. A 1px black-on-black text-shadow should thin the font out. Any browser that doesn't support text-shadow will be rendering the font horribly anyway.
请记住,某些 html 元素默认为粗体,例如 h1、h2...当我使用 font squirrel 生成字体并将其与 h1 一起使用时,例如,我总是输入:
And remember that some html elements has bold as default, like h1, h2... When I use font squirrel to generate a font and use it with h1, for example, I always put: