A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/twbs/bootlint/wiki/E047 below:

E047 · twbs/bootlint Wiki · GitHub

.btn should only be used on <a>, <button>, <input>, or <label> elements.

.btn is used to style an element as an interactive, clickable button.

Creating button-ish widgets using elements other than <a>, <button>, <input>, or <label> can cause problems for users of assistive technologies (such as screen readers) since by default such widgets won't be recognized as interactive by the technology, unless you put in extra work involving ARIA attributes, tabindex attributes, and custom JavaScript.

Such widgets are also semantically dubious. A <button> element represents a button, with the inherent associated semantics (e.g. can be interacted with via clicking). By contrast, a <div> or <span> element has no such inherent meaning (although utilizing ARIA can remedy this, to some degree).

Wrong:

<span class="btn btn-primary">Button</span>
<div class="btn btn-primary">Button</div>

Right:

<a class="btn btn-primary">Button</a>
<button type="button" class="btn btn-primary">Button</button>
<input type="button" class="btn btn-primary" value="Button">
<label class="btn btn-primary">Button</label>

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4