![]() |
VOOZH | about |
Bootstrap 5 Toasts which are used to show the alert notifications. Toasts are brief alerts designed to resemble the push notifications made popular by mobile and desktop operating systems. The Toast Placement feature is used to set the position of the toast on the web page.
Bootstrap 5 Toasts Placement Class:
Syntax: The * can be any value from 0 to 50.
<div class="toast-container position-absolute top|bottom|start|end-*"> <div class="toast"> <div class="toast-header"> ... </div> <div class="toast-body"> ... </div> </div> </div>
Example 1: The following code demonstrates the Toasts Placement feature and set the position of Toast at the top left, top center, and top right of the web page using the Toasts Placement Bootstrap 5 properties.
Output:
Example 2: The following code demonstrates the Toasts Placement feature and set the position of Toast at the middle left, middle center, and middle right of the web page using the Toasts Placement Bootstrap 5 properties.
Output:
Example 3: The following code demonstrates the Toasts Placement feature and set the position of Toast at the bottom left, bottom center, and bottom right of the web page using the Toasts Placement Bootstrap 5 properties.
Output:
Reference: https://getbootstrap.com/docs/5.0/components/toasts/#placement