Personalized checkout and custom promotions with Shopify Scripts
Hello this is Sneh.
I am having issues while adding a simple html css modal to the theme.liquid file.
How can I add this on my website?
This is the html code:
<script type="text/javascript">
// Removes the HTML dag div with the class popup from javascript using in-built html-JS methods
function myFunction() {
document.getElementById("cls1").innerHTML = "";
}
</script>
<div id="cls1">
<div class="popup">
<h2>Pop-up name here</h2>
<button class="close" onclick="myFunction()">×</button>
<div class="content">
Pop-Up text here.
</div>
</div>
</div>
.popup {
padding: 55px;
background: #72C6D5;
border-radius: 5px;
width: 30%;
position: fixed;
bottom: 0;
right: 0;
transition: all 5s ease-in-out;
}
.popup h2 {
margin-top: 0;
color: #333;
font-family: Tahoma, Arial, sans-serif;
}
.popup .close {
position: absolute;
top: 20px;
right: 30px;
transition: all 200ms;
font-size: 30px;
font-weight: bold;
text-decoration: none;
color: #333;
}
.popup .close:hover {
color: #06D85F;
}
.popup .content {
max-height: 30%;
overflow: auto;
}
@media screen and (max-width: 700px){
.box{
width: 70%;
}
.popup{
width: 70%;
}
}
This is the css:
User | RANK |
---|---|
4 | |
2 | |
2 | |
1 | |
1 |
On our Shopify Expert Marketplace, you can find many trusted third party developers and fr...
By Arno Nov 27, 2023You've downloaded the Search & Discovery app from the Shopify App store, and as you're ...
By Skye Nov 8, 2023The year-end shopping season is just around the corner. Is a flash sale on your radar? Are...
By Jasonh Nov 6, 2023