alert-warning

bootstrap5.css

bootstrap5.css
.alert-warning {
  color: #664d03;
  background-color: #fff3cd;
  border-color: #ffecb5;
}
bootstrap5.css
.alert-warning .alert-link {
  color: #523e02;
}

html bootstrap5 Sample

アラートの背景色:alert-*


  <div class="alert alert-primary" role="alert">alert-primary</div>
  <div class="alert alert-secondary" role="alert">alert-secondary</div>
  <div class="alert alert-success" role="alert">alert-success</div>
  <div class="alert alert-danger" role="alert">alert-danger</div>
  <div class="alert alert-warning" role="alert">alert-warning</div>
  <div class="alert alert-info" role="alert">alert-info</div>
  <div class="alert alert-light" role="alert">alert-light</div>
  <div class="alert alert-dark" role="alert">alert-dark</div>

js アラートを閉じるボタンで消す:alert-bs-dismissible


  <!-- btn-closeで×マーク background: svg -->
  <div class="alert alert-warning alert-dismissible fade show" role="alert">
    右側の「×」マークをクリックするとアラートが閉じます
    <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close">
    </button>
  </div>