In mobile there is a very common component that is known as " Toast ", but I was thinking about how to adapt it only with HTML and CSS
Isthereanywaytodosomethinglikethis"component" above just using CSS and HTML, without framework or other libraries?
I came up with this template below, but I would like to make it functional like these% Toast types that we see mostly on Android ...
How to make it rise and stand still, and then click on the X to close it?
.btn {
background-color: purple;
border-radius: .5em;
box-shadow: 0 .25em .5em 0 rgba(0, 0, 0, .25);
padding: 1em;
color: #fff;
text-transform: uppercase;
font-family: sans-serif;
font-weight: bold;
border: none;
cursor: pointer;
transition: background-color 250ms;
}
.btn:hover {
background-color: rgb(100, 0, 100);
}
.toast {
position: fixed;
display: flex;
bottom: 0;
left: 0;
width: 100%;
justify-content: space-between;
background-color: rgb(100, 0, 100);
font-family: sans-serif;
}
.toast p,
.toast a {
color: #fff;
margin: 0;
padding: 2em;
text-decoration: none;
}
<br>
<label class="btn" for="open">TOAST</label>
<br>
<div class="toast">
<p>
Lorem, ipsum dolor.
</p>
<a href="#">
X
</a>
</div>