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

How to set font bold effect in css

王林
王林Original
2021-05-18 16:06:3328278browse

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>

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!

Statement:
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