You can use the font-weight attribute to bold a font in CSS. The default value is normal, and the bold value is bold. It also supports lighter (lighter), heavier (bolder), and 100-900 values (400 is normal ).
Bold fonts in CSS
Bold fonts in CSS is very simple, you can usefont-weight
attribute.
HTML Code
<p>这是普通文本</p> <p><strong>这是加粗文本</strong></p>
CSS Code
p { font-weight: normal; } strong { font-weight: bold; }
In this example, normal
is the font The default weight of , while bold
is the bold weight.
In addition to normal
and bold
, the font-weight
property also supports the following values:
- lighter: lighter than the current font weight
- bolder: heavier than the current font weight
- 100: the lightest Font weight
- 200 - 900: Between light and heavy font weights (where 400 is the normal weight)
Example
To make text bold to medium weight, you can use the following CSS:
p { font-weight: 600; }
Browser support
# The ##font-weight attribute is well supported by all modern browsers.
The above is the detailed content of How to make font bold in css. For more information, please follow other related articles on the PHP Chinese website!

Here's a container with some child elements:

Flyout menus! The second you need to implement a menu that uses a hover event to display more menu items, you're in tricky territory. For one, they should

"The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect."- Tim Berners-Lee

In this week's roundup: datepickers are giving keyboard users headaches, a new web component compiler that helps fight FOUC, we finally get our hands on styling list item markers, and four steps to getting webmentions on your site.

The short answer: flex-shrink and flex-basis are probably what you’re lookin’ for.

In this week's look around the world of web platform news, Google Search Console makes it easier to view crawled markup, we learn that custom properties

The IndieWeb is a thing! They've got a conference coming up and everything. The New Yorker is even writing about it:


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Atom editor mac version download
The most popular open source editor

SublimeText3 Linux new version
SublimeText3 Linux latest version

SublimeText3 Mac version
God-level code editing software (SublimeText3)

SublimeText3 English version
Recommended: Win version, supports code prompts!

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.