How to change font thickness in css

青灯夜游
Release: 2023-02-17 15:15:45
Original
8499 people have browsed it

In CSS, the font thickness can be modified with the font-weight attribute. You only need to set the value of the font-weight attribute to "bold", "bolder", "lighter" or "500" or "600" , "700", "800", and "900" are sufficient. The larger the attribute value, the bolder the font.

How to change font thickness in css

The operating environment of this tutorial: Windows 7 system, CSS3&&HTML5 version, Dell G3 computer.

In CSS, the font thickness can be modified using the font-weight attribute.

CSS font-weight property

The font-weight property can be used to set the thickness of text. The larger the attribute value, the bolder the font.

Attribute value:

Value Description
normal default value. Defines standard characters.
bold Define bold characters.
bolder Define bolder characters.
lighter Define finer characters.
  • 100
  • 200
  • 300
  • 400
  • 500
  • 600
  • 700
  • 800
  • 900
Define characters from thin to thick. 400 is equivalent to normal, and 700 is equivalent to bold.

Example:

    css 文字加粗  

这是一段测试文字--默认粗细

这是一段测试文字

这是一段测试文字

这是一段测试文字

这是一段测试文字

这是一段测试文字

这是一段测试文字

这是一段测试文字

这是一段测试文字

这是一段测试文字

Copy after login

How to change font thickness in css

[Recommended tutorial:CSS video tutorial]

The above is the detailed content of How to change font thickness 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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!