Add a simple html css modal in theme.liquid

2 0 0

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 = "";


<div id="cls1">
<div class="popup">
<h2>Pop-up name here</h2>

<button class="close" onclick="myFunction()">&times;</button>

<div class="content">
Pop-Up text here.



.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){
width: 70%;
width: 70%;

This is the css: 

Replies 0 (0)