پیشنمایش زنده
کد HTML
<div class="notifications-container">
<div class="dad-joke">
<div class="flex">
<div class="flex-shrink-0">
<svg aria-hidden="true" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" class="dad-joke-svg">
<path clip-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z" fill-rule="evenodd"></path>
</svg>
</div>
<div class="dad-joke-prompt-wrap">
<p class="dad-joke-prompt-heading">Dad Jokes Alert!</p>
<div class="dad-joke-prompt">
<p>
Why don’t scientists trust atoms? Because they make up everything.
</p>
</div>
<div class="dad-joke-button-container">
<button class="dad-joke-button-main" type="button">
Make It Stop
</button>
</div>
</div>
</div>
</div>
</div>
کد CSS
.notifications-container {
width: 320px;
height: auto;
font-size: 0.875rem;
line-height: 1.25rem;
display: flex;
flex-direction: column;
gap: 1rem;
}
.flex {
display: flex;
}
.flex-shrink-0 {
flex-shrink: 0;
}
.dad-joke {
padding: 1rem;
border-radius: 0.375rem;
background-color: rgb(248, 231, 28);
}
.dad-joke-svg {
color: rgb(255, 255, 255);
width: 1.25rem;
height: 1.25rem;
}
.dad-joke-prompt-wrap {
margin-left: 0.75rem;
}
.dad-joke-prompt-heading {
font-weight: bold;
color: rgb(57, 55, 54);
}
.dad-joke-prompt {
margin-top: 0.5rem;
color: rgb(57, 55, 54);
}
.dad-joke-button-container {
display: flex;
margin-top: 0.875rem;
margin-bottom: -0.375rem;
margin-left: -0.5rem;
margin-right: -0.5rem;
}
.dad-joke-button-main {
padding-top: 0.375rem;
padding-bottom: 0.375rem;
padding-left: 0.5rem;
padding-right: 0.5rem;
background-color: #F75404;
color: #FFFFFF;
font-size: 0.875rem;
line-height: 1.25rem;
font-weight: bold;
border-radius: 0.375rem;
border: none
}
.dad-joke-button-main:hover {
background-color: #D1410C;
}