There is more than one way to create bold text in HTML. Below are the various methods of creating bold text.
The
Tag
The
tag is used to give text a stronger importance. Only use this tag when the enclosed text is actually more important than its surrounding text.
The
Tag
The
tag is to markup text as bold without conveying any extra importance. For example, this could be useful in article abstracts, where the beginning of an article is set in bold text.Using Cascading Style Sheets (CSS)
You can use CSS instead of, or in conjunction with, the above HTML tags. To make text bold with CSS, use thefont-weight
property. Here's an example:Source Code | Result |
---|---|
font-weight: normal
font-weight: bold
font-weight: bolder
font-weight: lighter
font-weight: 100
font-weight: 200
font-weight: 300
font-weight: 400
font-weight: 500
font-weight: 600
font-weight: 700
font-weight: 800
font-weight: 900
|
bold
and normal
(which overrides any bold setting).
0 comments:
Post a Comment