Why does "font-weight: bolder" skip boldness steps?

Zilk

According to the MDN page on font-weight and other sources, font-weight: bolder makes text content "one font weight darker than the parent element (among the available weights of the font)."

I have a test page with the "Open Sans" font included from Google Fonts, with the weights 300, 400 (aka "normal"), 600, 700 (aka "bold"), and 800. Setting the numeric font weights manually works as expected, but using bolder seems to skip the font weight 600.

Firefox and Chrome agree on this, so I'm probably misunderstanding what "one step" means in this context.

Here's a JSFiddle for testing, and a screenshot of the results I'm getting.

enter image description here

The first section has manual numeric font-weight settings. The second has nested div blocks styled with font-weight: lighter (works as expected), the third has nested div blocks with font-weight: bolder; this one shows the effect I'm trying to understand.

James Donnelly

From the font-weight section of the CSS2.1 specification:

Values of 'bolder' and 'lighter' indicate values relative to the weight of the parent element. Based on the inherited weight value, the weight used is calculated using the chart below. Child elements inherit the calculated weight, not a value of 'bolder' or 'lighter'.

Inherited val   bolder  lighter
100             400     100
200             400     100
300             400     100
400             700     100
500             700     100
600             900     400
700             900     400
800             900     700
900             900     700

This means that anything bolder than a font-weight of 400 is given a weight of 700, and anything bolder than a font-weight of 700 is given a weight of 900.

This is exactly what is happening in your JSFiddle demo.

Bolder

This is some text with weight 400.        <!-- 400 -->
This text is one step bolder than above.  <!-- bolder than 400 = 700 -->
This text is one step bolder than above.  <!-- bolder than 700 = 900 -->
This text is one step bolder than above.  <!-- bolder than 900 = 900 -->
This text is one step bolder than above.  <!-- ... -->

Lighter

This is some text with weight 400.        <!-- 400 -->
This text is one step lighter than above. <!-- lighter than 400 = 100 -->
This text is one step lighter than above. <!-- lighter than 100 = 100 -->
This text is one step lighter than above. <!-- ... -->

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Why does my loop skip even steps?

From Dev

Why does NSNumberFormatter skip a number?

From Dev

Why does it skip the "control" segment?

From Dev

Check Session object so that user does not skip steps in a form

From Dev

Skip steps in fsevents queue

From Dev

Why does "return;" skip iterations in $.each()?

From Dev

Why does the code skip the for-loop

From Dev

why does javascript skip some of my functions?

From Dev

why does javascript skip some of my functions?

From Dev

Why does Xcode skip for loop code?

From Dev

Why does this recursive function skip numbers?

From Dev

Snake Game - why does the snake skip a tile?

From Dev

Why does scanf skip getting string input?

From Dev

Why does my pandas filters work in separate steps but not in one command?

From Dev

Why does next_permutation skip some permutations?

From Dev

Why does the GDB 'step' command skip struct declarations?

From Dev

Why does csv.DictReader skip empty lines?

From Dev

Why Does Js Slideshow Skip First Two Slides?

From Dev

Why does this generator skip a yield outside the try block?

From Dev

Kubernetes:Why does the 'insecure-skip-tls-verify' in kubeconfig not work?

From Dev

Why does `do-release-upgrade` skip a version?

From Dev

Why does Mockito skip the initialization of the member variable of my abstract class

From Dev

Why does xargs skip first argument when passing to subshell?

From Dev

Why does `do-release-upgrade` skip a version?

From Dev

Why does When.js promise.then skip a function?

From Dev

why does foreach skip 2 rows from the query result?

From Dev

Why does `find` in Linux skip expected results when `-o` is used?

From Dev

Why does my for loop skip my last values in my array?

From Dev

Why does my call to an MVS POST function skip the RedirectToAction?

Related Related

  1. 1

    Why does my loop skip even steps?

  2. 2

    Why does NSNumberFormatter skip a number?

  3. 3

    Why does it skip the "control" segment?

  4. 4

    Check Session object so that user does not skip steps in a form

  5. 5

    Skip steps in fsevents queue

  6. 6

    Why does "return;" skip iterations in $.each()?

  7. 7

    Why does the code skip the for-loop

  8. 8

    why does javascript skip some of my functions?

  9. 9

    why does javascript skip some of my functions?

  10. 10

    Why does Xcode skip for loop code?

  11. 11

    Why does this recursive function skip numbers?

  12. 12

    Snake Game - why does the snake skip a tile?

  13. 13

    Why does scanf skip getting string input?

  14. 14

    Why does my pandas filters work in separate steps but not in one command?

  15. 15

    Why does next_permutation skip some permutations?

  16. 16

    Why does the GDB 'step' command skip struct declarations?

  17. 17

    Why does csv.DictReader skip empty lines?

  18. 18

    Why Does Js Slideshow Skip First Two Slides?

  19. 19

    Why does this generator skip a yield outside the try block?

  20. 20

    Kubernetes:Why does the 'insecure-skip-tls-verify' in kubeconfig not work?

  21. 21

    Why does `do-release-upgrade` skip a version?

  22. 22

    Why does Mockito skip the initialization of the member variable of my abstract class

  23. 23

    Why does xargs skip first argument when passing to subshell?

  24. 24

    Why does `do-release-upgrade` skip a version?

  25. 25

    Why does When.js promise.then skip a function?

  26. 26

    why does foreach skip 2 rows from the query result?

  27. 27

    Why does `find` in Linux skip expected results when `-o` is used?

  28. 28

    Why does my for loop skip my last values in my array?

  29. 29

    Why does my call to an MVS POST function skip the RedirectToAction?

HotTag

Archive