如何通过CSS设置“半粗体”字体? 600的字体重量不让它看起来像我在我的Photoshop文件中看到的半粗体 [英] How do I set 'semi-bold' font via CSS? Font-weight of 600 doesn't make it look like the semi-bold I see in my Photoshop file

查看:1285
本文介绍了如何通过CSS设置“半粗体”字体? 600的字体重量不让它看起来像我在我的Photoshop文件中看到的半粗体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在进行Photoshop-to- XHTML 转换,网站设计人员使用Myriad Pro半粗体字体在photoshop文件看起来不错,但当我尝试在CSS中的半粗体选项,它看起来很像一个正常的粗体字体,这是太粗糙的我的目的。有没有办法在HTML和CSS中实现更好的半粗体字体或者我只是停留在'font-weight:600;'?

I'm doing a Photoshop-to-XHTML conversion, and the website designer used the Myriad Pro Semi-bold font which looks good in the photoshop file, but when I try the semi-bold option in CSS, it looks pretty much like a normal bold font, which is too bold for my purpose. Is there a way to achieve a nicer looking semi-bold font in HTML and CSS or am I just stuck with 'font-weight: 600;'?

推荐答案

实际的方法是将 font-family 设置为半包版本的特定名称,例如

The practical way is setting font-family to a value that is the specific name of the semibold version, such as

font-family: "Myriad pro Semibold"

如果这是名称。 (个人我使用自己的字体列表工具,它在Internet Explorer上运行只能查看字体在我的系统中通过名称在CSS中可用。)

if that’s the name. (Personally I use my own font listing tool, which runs on Internet Explorer only to see the fonts in my system by names as usable in CSS.)

在这种方法中,不需要 font-weight

In this approach, font-weight is not needed (and probably better not set).

网页浏览器在书中实现字体重量的能力很差:他们很大程度上找不到特定的重量版本,除了粗体。解决方法是在字体系列名称中包含信息,即使这不是应该如何工作。

Web browsers have been poor at implementing font weights by the book: they largely cannot find the specific weight version, except bold. The workaround is to include the information in the font family name, even though this is not how things are supposed to work.

使用Segoe UI进行测试,通常存在于不同的在使用逻辑方法(使用字体系列名称Segoe UI和不同的 font-weight 值),但它在Firefox 9和Chrome 16(仅正常和大胆的工作)失败。在所有这些浏览器上,例如,设置 font-family:Segoe UI Light 可以正常工作。

Testing with Segoe UI, which often exists in different font weight versions on Windows systems, I was able to make Internet Explorer 9 select the proper version when using the logical approach (of using the font family name Segoe UI and different font-weight values), but it failed on Firefox 9 and Chrome 16 (only normal and bold work). On all of these browsers, for example, setting font-family: Segoe UI Light works OK.

这篇关于如何通过CSS设置“半粗体”字体? 600的字体重量不让它看起来像我在我的Photoshop文件中看到的半粗体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆