Skip to content
This repository has been archived by the owner on Feb 1, 2022. It is now read-only.
cvrebert edited this page Oct 30, 2014 · 1 revision

E034

.close button for .alert must be the first element in the .alert

Wrong:

<div class="alert alert-warning alert-dismissible" role="alert">
  You're not looking too good.
  <button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
  Better check yourself 
</div>

<div class="alert alert-warning alert-dismissible" role="alert">
  <ul>
    <li>Other elements like this list should come after the close button</li>
  </ul>
  <button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
  Better check yourself, you're not looking too good.
</div>

Right:

<div class="alert alert-warning alert-dismissible" role="alert">
  <button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
  Better check yourself, you're not looking too good.
</div>

<div class="alert alert-warning alert-dismissible" role="alert">
  <button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
  <ul>
    <li>Other elements like this list should come after the close button</li>
  </ul>
  Better check yourself, you're not looking too good.
</div>
Clone this wiki locally