alert-warning

bootstrap5.css

bootstrap5.css
.alert-warning {
  color: #856404;
  background-color: #fff3cd;
  border-color: #ffeeba;
}
bootstrap5.css
.alert-warning hr {
  border-top-color: #ffe8a1;
}
bootstrap5.css
.alert-warning .alert-link {
  color: #533f03;
}

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>

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


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