Bootstrap By Example by Silvio Moreto

Bootstrap By Example by Silvio Moreto

Author:Silvio Moreto [Moreto, Silvio]
Language: eng
Format: epub, pdf
Publisher: Packt Publishing
Published: 2016-03-29T22:00:00+00:00


The HTML code for creating this alert is really simple:

<div class="alert alert-success" role="alert"> You have made a new Tweet. </div>

As mentioned before, just create an element with the .alert class in combination with the state of the alert, .alert-success in this case.

Tip

Why do we use the role attribute?

In the preceding example, we made use of the role="alert" attribute in our .alert component. The role attribute was incorporated into HTML 5, coming from the ARIA 1.0 specification. The reason for using that is to keep the semantics for different items, for example, in this case, where we used a common <div> to describe a more semantic element that is an alert.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.