Home > Web Front-end > CSS Tutorial > How to set font bold effect in css

How to set font bold effect in css

王林
Release: 2023-01-06 11:13:56
Original
28370 people have browsed it

The way to set the font bold effect in css is to add the font-weight attribute to the font and set the attribute value to bold or bolder, such as [font-weight:bolder] or [font-weight:bold] .

How to set font bold effect in css

The operating environment of this article: windows10 system, css 3, thinkpad t480 computer.

To achieve a bold font effect, we can use the font-weight attribute, which can set the thickness of the text.

Attribute value:

  • normal Default value. Defines standard characters.

  • #bold Defines bold characters.

  • #bolder Defines bolder characters.

  • #lighter Defines finer characters.

Example:

<html>
<head>
<style type="text/css">
p.normal {font-weight: normal}
p.thick {font-weight: bold}
p.thicker {font-weight: 900}
</style>
</head>

<body>
<p class="normal">This is a paragraph</p>

<p class="thick">This is a paragraph</p>

<p class="thicker">This is a paragraph</p>
</body>

</html>
Copy after login

Running effect:

How to set font bold effect in css

Related recommendations: css video tutorial

The above is the detailed content of How to set font bold effect in css. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template