strong
and b
tags not to increase the font-weight:700
to a fixed font-weight:700
, as is the default, but to use intermediate values calculated from the font weights. parent element.strong
tags appear in the ultra-thin font.font-weight
value. body { font-family: 'Open Sans', sans-serif; font-weight: 300; } h1, h2, h3, h4, h5, h6, blockquote { font-weight: 400; } .promo { font-weight: 600; }
strong
tag can appear in the main text, in quotations, and in the promotional block. It is necessary to take this into account. strong, b { font-weight: bold; /* bold = 700 */ }
strong
and b
to have a Normal 400 for the main text, Bold 700 for quotes and headings, and Extra-Bold 800 for the promo block. This will keep the contrast between bold and non-greasy text approximately equal in all cases.strong {font-weight: bolder;}
, but this did not bring the expected result - the text became even fatter than expected.bolder
( lighter
) value increases (decreases) the inherited font-weight
value to the next possible value for this font, according to the following table.inherited value | 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 |
strong, b {font-weight: bold;}
, i.e. the value “700” is inherited , and then it also increases to “900”. Therefore, it seems that the bolder
is not working properly. /* «bold», */ strong, b { font-weight: inherit; } /* bolder */ strong, b { font-weight: bolder; }
font-weight
value from the browser style sheet to zero, the second sets the fatness in relative, not absolute, units.strong
tags to each other.font-weight
values, we get only three gradations of the bolder
font for bolder
and lighter
respectively. The specification does not guarantee that browsers will correctly match the names of styles and numerical values. Does not guarantee that there will be a bold or thinner font for the font. Some fonts have only two styles, some may have eight.bolder
/ lighter
is that the font with the value “ bolder
” will not be thinner than the lighter features of this font, and with the value “ lighter
” it will not be thicker than the bold faces of this font.@font-face
, then Google Chrome determines only Normal and Bold font styles. In order for the local font to work, you need to additionally specify its font-family
. .fw300 { font-family: "Open Sans Light", "Open Sans"; font-weight: 300; } .fw600 { font-family: "Open Sans SemiBold", "Open Sans"; font-weight: 600; }
Source: https://habr.com/ru/post/211612/
All Articles