In CSS, font weight defines the degree of thickness in characters of a font. It is used to make text appear bold, semibold, or normal depending on the value set.
By default, the font weight is set to normal. For instance, in the following CSS code, the text will appear normal:
However, if you want to bolden the text, you can set the font weight to bold:
There are other font weight values you can use to represent different degrees of thickness:
It is important to note that not every font comes in all font weight values and the specified weight must be available in a chosen font family to work effectively.
In cases where a font weight value is unavailable, it defaults to the closest available weight in the font family.
Set the font weight of all h2 tags to
Set the font weight of the h1.title tag to
Set the font weight of the h3 tag to
Sign up to start coding
Already have an account?