on-internet
← Community

Showing a bootstrap alert message for a specific time in html and css

Stack Overflow ·

I have this element below that shows a success/failure banner across the screen. Is there a way I can set it in html/css to hide after 4 seconds? <div id=mainAlertMessage class="alert @message.CssClassName alert-dismissible" role="alert"> <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button> <div style="text-align: center"><strong>@message.Title</strong> @message.Message</div> </div> I'm showing it by setting tempData in my controllers like this TempData["UserMessage"] = new BannerMessage() { CssClassName = "alert-success",

Comments

Sign in or sign up to comment and upvote.

No comments yet.