The font-weight property
The font-weight property sets
or disables bold text.
Syntax
cssselector {
font-weight: bold | normal;
}
Values
| Value | Description |
|---|---|
bold |
Makes a text bold. |
normal |
Cancels bold. Usually necessary if you need
to make a tag that is bold by default (for
example, headings h1-h6 or
th).
|
Default value: different for each element - paragraphs are not bold by default, but headings are bold.
Example
Let's set a bold font for the paragraph:
html<p>
Lorem ipsum dolor sit amet.
</p>cssp {
font-weight: bold;
}
Результат:
Example
Let's cancel a bold font for the title (it's bold by default):
html<h2>Lorem ipsum</h2>cssh2 {
font-weight: normal;
}
Результат: