为什么这个类“font-weight-bold”不起作用? [引导]

问题描述 投票:0回答:5
html bootstrap-4
5个回答
46
投票

它是

font-weight-bold
用于 Bootstrap 4

class="fw-bold"
用于 Bootstrap 5


7
投票

使用

class= "fw-bold"
对我有用。我正在使用 Bootstrap 5。


3
投票

引导版本 5

<p class="fw-bold">YOUR_TEXT</p>

引导程序版本 4

<p class="font-weight-bold">YOUR_TEXT</p>

引导程序版本< 4

<strong>YOUR_TEXT</strong>

对于其他样式,例如正常和斜体:

引导程序4
<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
引导5
<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> 

1
投票

你必须使用

font-weight-bold
但是你使用了
text-weight-bold
这就是为什么你的引导类风格不起作用


1
投票

之前版本bootstrap 5使用

class='font-weight-bold'
,但是bootstrap 5使用
class='fw-bold'

© www.soinside.com 2019 - 2024. All rights reserved.