Home > Web Front-end > Front-end Q&A > How to set font not to be bold in css

How to set font not to be bold in css

PHPz
Release: 2023-04-24 09:48:13
Original
2081 people have browsed it

Many times, when we display web content, we need to choose different fonts to present text to achieve better readability and visual effects. In this process, we often use CSS to control text style and font display.

There are many properties in CSS that can control the style of text and the display of fonts, such as font-family, font-size, font-weight, etc. We can use these attributes to select different fonts, such as the commonly used Song Dynasty, Microsoft Yahei, Arial, Times New Roman, etc. But if these fonts are bolded, they sometimes look very abrupt and are not conducive to reading.

So how to remove the bold font? It's actually very simple, just set the font-weight property in CSS to normal. The specific method is as follows:

body {
  font-family: Arial, sans-serif;
  font-size: 16px;
  font-weight: normal;
}
Copy after login

In the above code, we set the font-weight attribute to normal so that the text will not be bolded. At the same time, we also set the font size and font type for better reading.

Of course, if you don’t like the font Arial, you can also change it to other fonts, such as Song Dynasty, Microsoft Yahei, etc. Just set the font-family property to the corresponding font.

In addition to using normal, we can also use the two attributes lighter and bolder to adjust the thickness of the font. When using lighter, the font becomes thinner, and when using bolder, it becomes thicker.

In actual development, we can choose different fonts according to different scenarios to adapt to different display needs. For example, in the page title, we can choose an atmospheric and bold font to highlight the importance of the title; while in the main text, we need to choose a more comfortable and easy-to-read font to facilitate user reading.

In short, by adjusting the thickness of the font, we can create more beautiful and easy-to-read web content and provide users with a better reading experience.

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

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