Home>Article>Web Front-end> What is the website style css bold code?
The website style css bold code is "text element {font-weight: bold;}" or "text element {font-weight: bolder;}". The font-weight attribute is used to set the thickness of text. When the value of this attribute is set to "bold", bold characters can be defined, and when set to "bolder", thicker characters can be defined; the value of the font-weight attribute can also be set. The value is "700", "800" or "900", which can also achieve the text bolding effect.
The operating environment of this tutorial: Windows 7 system, CSS3&&HTML5 version, Dell G3 computer.
Website style css bold code:
文字元素{font-weight: bold;} 文字元素{font-weight: bolder;}
The CSS attribute used is: font bold attribute "font-weight".
The font-weight attribute can set the thickness of the text and supports multiple attribute values:
Value | Description |
---|---|
normal | Default value. Defines standard characters, equal to 400. |
bold | Defines bold characters, equal to 700. |
bolder | Define bolder characters. |
lighter | Define finer characters. |
|
Define characters from thin to thick. 400 is equivalent to normal, and 700 is equivalent to bold. |
Example: Set different font weights for four paragraphs
css 文字加粗 测试文本!
测试文本!
测试文本!
测试文本!
Note: The default font-weight ofstrong, b, h1~h6 and other tags is bold
(Learning video sharing:css video tutorial)
The above is the detailed content of What is the website style css bold code?. For more information, please follow other related articles on the PHP Chinese website!