Text Alignment
The w3-left-align and the w3-right-align classes are used to align text.
Left aligned text.
Right aligned text.
Example
Left aligned text.
Right aligned text.
Try It Yourself »
Centering Elements
The w3-center class is used to center-align elements:
Centered Content
Some centered text.
Example
Centered Content
Some centered text.
Try It Yourself »
Wide Text
The w3-wide class specifies a wider text:
This text is normal.
This text is wider.
Example
The w3-wide class specifies a wider text.
Try It Yourself »
Text Opacity
The w3-opacity class is designed to work with all colors:
Text Opacity
Text Opacity
Text Opacity
Text Opacity
Example
Text Opacity
Try It Yourself »
Text Shadow
The CSS3 text-shadow property can be used to add shadow or blur effects to text:
Text Shadow
Text Shadow
Text Shadow
Text Shadow
Example
Text Shadow
Try It Yourself »
Special Effects
Text Opacity + Bold
Yellow Text + Shadow + Bold
Orange Text + Shadow + Bold
Example
Text Opacity + Bold
Yellow Text + Shadow + Bold
Orange Text + Shadow + Bold
Try It Yourself »
Text Shadow does not work in IE 9 and earlier.
Example
Set different font weight for three paragraphs:
p.normal {
font-weight: normal;
}
p.thick {
font-weight: bold;
}
p.thicker {
font-weight: 900;
}
Try it Yourself »
Definition and Usage
The font-weight
property sets how thick or thin characters in
text should be displayed.
Show demo ❯
Browser Support
The numbers in the table specify the first browser version that fully supports the property.
font-weight | 2.0 | 4.0 | 1.0 | 1.3 | 3.5 |
CSS Syntax
font-weight: normal|bold|bolder|lighter|number|initial|inherit;
Property Values
normal | Defines normal characters. This is default | Demo ❯ |
bold | Defines thick characters | Demo ❯ |
bolder | Defines thicker characters | Demo ❯ |
lighter | Defines lighter characters | Demo ❯ |
100 200 300 400 500 600 700 800 900 | Defines from thin to thick characters. 400 is the same as normal, and 700 is the same as bold | Demo ❯ |
initial | Sets this property to its default value. Read about initial | |
inherit | Inherits this property from its parent element. Read about inherit |
Related Pages
CSS tutorial: CSS Font
CSS reference: font property
HTML DOM reference: fontWeight property
1.Thuộc Tính In đậm Trong CSS Và Cách Sử Dụng - Blog | Got It AI
Thẻ in đậm text trong CSS là thẻ font-weight . Thẻ này sẽ giúp thay đổi độ mỏng và dày của chữ tùy theo mục đích của lập trình viên. Thẻ font-weight mang lại rất nhiều lựa chọn cho bạn so với thẻ bold và strong trong HTML. Thuộc tính font-weight được hỗ trợ bởi hầu hết các trình duyệt như Chrome, Firefox, Safari,… 7 thg 2, 2021
Xem chi tiết »
2.In đậm Chữ Trong Css
6 thg 6, 2021 · IN ĐẬM CHỮ TRONG CSS · Thẻ in đậm vào CSS là gì? trong số những biện pháp về tối ưu rộng nhằm in đậm text là áp dụng thẻ in đậm vào CSS. Thẻ in ...
Xem chi tiết »
3.Thuộc Tính Font | CSS | Học Web Chuẩn
Hiển thị chữ đậm hay thường. Ví dụ. Xem thêm ví dụ. HTML viết: