Alerts are used in website due user actions ðŸ’
<div class="bg-gray-50"> <div class="mx-auto max-w-7xl py-12 px-4 sm:px-6 lg:flex lg:items-center lg:justify-between lg:py-16 lg:px-8"> <h2 class="text-3xl font-bold tracking-tight text-gray-900 sm:text-4xl"> <span class="block">Ready to dive in?</span> <span class="block text-indigo-600">Start your free trial today.</span> </h2> <div class="mt-8 flex lg:mt-0 lg:flex-shrink-0"> <div class="inline-flex rounded-md shadow"> <a href="#" class="inline-flex items-center justify-center rounded-md border border-transparent bg-indigo-600 px-5 py-3 text-base font-medium text-white hover:bg-indigo-700"> Get started </a> </div> <div class="ml-3 inline-flex rounded-md shadow"> <a href="#" class="inline-flex items-center justify-center rounded-md border border-transparent bg-white px-5 py-3 text-base font-medium text-indigo-600 hover:bg-indigo-50"> Learn more </a> </div> </div> </div> </div>
<div class="relative m-4 rounded border-0 bg-red-500 px-6 py-4 text-white"> <span class="mr-5 inline-block align-middle text-xl"> <i class="fas fa-bell"></i> </span> <span class="mr-8 inline-block align-middle"> <b class="capitalize">red!</b> This is a pink alert - check it out! </span> <button class="absolute right-0 top-0 mt-4 mr-6 bg-transparent text-2xl font-semibold leading-none outline-none focus:outline-none" onclick="closeAlert(event)"> <span>×</span> </button> </div> <script> function closeAlert(event){ let element = event.target; while(element.nodeName !== "BUTTON"){ element = element.parentNode; } element.parentNode.parentNode.removeChild(element.parentNode); } </script>