In this post i am going to share Stylish Popup Html code. you can use this code in your website to generate more sells.

Stylish Popup Html
<main class="main">
<div class="card-offer">
<button class="card-close">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
<circle cx="12" cy="12" r="9"></circle>
<path d="M10 10l4 4m0 -4l-4 4"></path>
</svg>
</button>
<div class="card-header">
<img src="https://technicalsudip.com/wp-content/uploads/2022/01/20211106_213900-scaled.jpg" />
</div>
<div class="card-body">
<h3>Hiya</h3>
<h1>This Is Popup Heading </h1>
<h2>This is H2</h2>
<p>
Description Here
</p>
<button>Button</button>
</div>
</div>
<span class="hi">🙂</span>
</main>
Stylish Popup CSS
*{
padding: 0;
margin: 0;
box-sizing: border-box;
}
main{
background: #ddd;
width: 100vw;
height: 100vh;
display: flex;
align-items: center;
justify-content: center;
font-family: sans-serif;
position: relative;
padding: 30px 0;
}
.card-offer{
display: flex;
flex-direction: row;
flex-wrap: wrap;
max-width: calc(100% - 50px);
min-height: 220px;
position: relative;
background-color: #242429;
border-radius: 16px;
color: #efefef;
align-items: center;
z-index: 100;
box-shadow: rgba(0, 0, 0, 0.24) 0px 3px 8px;
}
.card-offer > button{
position: absolute;
top: -10px;
right: -10px;
border: unset;
cursor: pointer;
background: unset;
}
.card-offer > button svg{
stroke: #dd5555;
transition: 250ms linear;
fill: #242429;
width: 28px;
height: 28px;
}
.card-offer > button:hover svg{
stroke: #dd2525
}
.card-offer .card-header{
width: 35%;
height: 100%;
overflow: hidden;
border-radius: 16px 0px 0 16px;
}
.card-offer .card-header img{
width: auto;
height: 100%;
max-width: 100%;
display: block;
}
.card-offer .card-body{
padding: 16px;
displa: flex;
flex-direction: column;
flex-wrap: wrap;
width: 60%;
min-width: 390px;
}
.card-offer .card-body h1{
font-size: 20px;
margin: 8px 0;
}
.card-offer .card-body h2{
font-size: 16px;
color: #efefef;
font-weight: 500;
letter-spacing: 0.02rem
}
.card-offer .card-body h3{
font-size: 16px;
color: #16a085;
font-weight: 500;
}
.card-offer .card-body p{
margin: 16px 0px;
color: #efefef55;
line-height: 1.5rem;
}
.card-offer .card-body button{
width: 230px;
height: 44px;
font-size: 13px;
font-weight: bold;
background: #16a085;
border: 0;
color: #efefef;
border-radius: 8px;
text-transform: uppercase;
cursor: pointer;
transition: 350ms ease-in-out;
}
.card-offer .card-body button:hover{
background: #1abc9c;
}
@media (max-width: 650px){
.card-offer{
max-width: 280px;
min-height: auto;
flex-direction: column;
align-items: flex-start;
}
.card-offer .card-header{
width: 100%;
height: auto;
border-radius: 16px 16px 0px 0px;
}
.card-offer .card-header img{
width: 100%;
height: auto;
max-height: 250px;
display: block;
object-fit: cover;
}
.card-offer .card-body h1{
font-size: 18px;
}
.card-offer .card-body h2{
font-size: 14px;
}
.card-offer .card-body h3{
font-size: 14px;
}
.card-offer .card-body{
width: 100%;
min-width: unset;
}
.card-offer .card-body p{
margin: 8px 0px;
color: #efefef55;
line-height: 1.5rem;
font-size: 14px;
}
.card-offer .card-body button{
width: 100%;
margin-bottom: 8px;
}
}
.hi{
display: block;
font-size: 36px;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
Stylish Popup JS
const close = document.querySelector(".card-close");
const card = document.querySelector(".card-offer");
close.addEventListener("click", (e) => {
if(card.style.display === "none"){
card.style.display = "flex"
}else{
card.style.display = "none"
}
})
Also Check