E034 - Herst/bootlint-ng GitHub Wiki

Note: Below is the original page from the Bootlint documentation, some of the info here might not apply to Bootlint-NG!


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>
⚠️ **GitHub.com Fallback** ⚠️