它是
font-weight-bold
用于 Bootstrap 4
和
class="fw-bold"
用于 Bootstrap 5
使用
class= "fw-bold"
对我有用。我正在使用 Bootstrap 5。
引导版本 5
<p class="fw-bold">YOUR_TEXT</p>
引导程序版本 4
<p class="font-weight-bold">YOUR_TEXT</p>
引导程序版本< 4
<strong>YOUR_TEXT</strong>
对于其他样式,例如正常和斜体:
<p class="font-weight-normal">YOUR_TEXT</p> // Normal
<p class="font-weight-light">YOUR_TEXT</p> // Light
<p class="font-italic">YOUR_TEXT</p> // Italic
<p class="fw-bolder">Bolder weight text (relative to the parent element).</p>
<p class="fw-normal">Normal weight text.</p>
<p class="fw-light">Light weight text.</p>
<p class="fw-lighter">Lighter weight text (relative to the parent element).</p>
<p class="fst-italic">Italic text.</p>
<p class="fst-normal">Text with normal font style</p>
你必须使用
font-weight-bold
但是你使用了text-weight-bold
这就是为什么你的引导类风格不起作用
之前版本bootstrap 5使用
class='font-weight-bold'
,但是bootstrap 5使用class='fw-bold'