简体   繁体   中英

CSS Font-weight -unseen differences?

I made this simple demo .

I can see in Visual studio , all the values which font-weight can have :

在此处输入图片说明

However when I tried all those values, I could locate only 4 distincts.

在此处输入图片说明

I added those red rectangles so you can see who has the same width.

why those all in the middle ( and those last) looks the same ? why do I need all those numbers?

Different fonts have different font weights available to them. Your browser is not attempting to simulate the missing weights (which is a good thing, that is hard to get right), so you are limited to the weights that exist in the installed version of the font you are using.

This can be either because the font doesn't support so many different weights or the browser can't display those weights.

Regardless, the numbers have to be there because that's how font weights work. If a font does support different weights then it is up to the browser to display it as accurately as it can; otherwise it tries to fall back gracefully to the nearest that's supported.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM