Bootstrap4 color

Bootstrap 4 provides some sense of color class representatives

.text-muted, .text-primary, .text-success, .text-info, .text-warning, .text-danger, .text-secondary, .text-white, .text-dark and .text-light

1: Text Color

< Div class = "Container" > 
  < h2 > represents the meaning specified text color </ h2 > 
  < the p- class = "text-muted" > soft text. </ P > 
  < P class = "text-Primary" > important text. </ P > 
  < P class = "text-Success" > successful implementation of the text. </ P > 
  < P class = "info-text" > represent some text message. </ P >
  = "text-warning" > warning text. </ P > 
  < P class = "Danger-text" > dangerous operation text. </ P > 
  < P class = "text-Secondary" > subtitle. </ P > 
  < P class = "text-Dark" > dark gray text. </ P > 
  < P class = "text-Light" > pale gray text (white background viewed unclear). </ P > 
  < P class = "text-White" > White text (white background point of view is not clear). </ The p->
</div>

 

2: Use the link

<div class="container">
  <h2>文本颜色</h2>
  <p>鼠标移动到链接。</p>
  <a href="#" class="text-muted">柔和的链接。</a>
  <a href="#" class="text-primary">主要链接。</a>
  <a href="#" class="text-success">成功链接。</a>
  <a href="#" class="text-info">信息文本链接。</a>
  <a href="#" class="text-warning">警告链接。</a>
  <a href="#" class="text-danger">危险链接。</a>
  <a href="#" class="text-secondary">副标题链接。</a>
  <a href="#" class="text-dark">深灰色链接。</a>
  <a href="#" class="text-light">浅灰色链接。</a>
</div>

 

3:背景颜色

提供背景颜色的类有: .bg-primary, .bg-success, .bg-info, .bg-warning, .bg-danger, .bg-secondary, .bg-dark 和 .bg-light。

注意背景颜色不会设置文本的颜色,在一些实例中你需要与 .text-* 类一起使用。
<div class="container">
  <h2>背景颜色</h2>
  <p class="bg-primary text-white">重要的背景颜色。</p>
  <p class="bg-success text-white">执行成功背景颜色。</p>
  <p class="bg-info text-white">信息提示背景颜色。</p>
  <p class="bg-warning text-white">警告背景颜色</p>
  <p class="bg-danger text-white">危险背景颜色。</p>
  <p class="bg-secondary text-white">副标题背景颜色。</p>
  <p class="bg-dark text-white">深灰背景颜色。</p>
  <p class="bg-light text-dark">浅灰背景颜色。</p>
</div>

 

 

 

 

Guess you like

Origin www.cnblogs.com/gjh99/p/11248519.html