How to open popup module in html

 

open popup module using php html css bootstrp

Step: 1 we create a html popuform.html

step: 2 In second step we create style.css file

step: 3 we create java script file for popup hiden and show


popup button
popup buton for oprn popup


Step1:

popuform.html page

<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="style.css">
<script src="myscript.js"></script>
 
</head>
<body>
    
    <!--<button class="open-button" onclick="openForm()">Open Form</button>-->
    <div>
        <button  class="button"  onclick="openForm()">
            <img src="chat.png"/>
        </button>
    </div>
    <div class="container" id="myForm" >
        <div class="wrapper">
            <div class="div1"></div>   
            <div class="formhad"><h2>Chat With us!</h2> </div>
            <div class="closediv"><button onclick="closeForm()" class="minbutton"> - </button> </div>
        </div>
        <div>
            <div class="gridsel">
                <h6 class="h6">KnowledgeBase</h6>
                <p class="p"> Save time with KnowledgeBase- easy to access know-how right in widget. 
                </p>
            </div>
            <div>
                <div class="chartbot">
                
                    <div class="p1">
                        <p>Hey, support heroes are live 24/7. Start a chat if you have any questions!</p>
                    </div>
                </div>
            </div>
   
            <div class="formbox">
                
                <form action="#" class="form">
                    <div>    
                        <label for="fname">Your Name</label>
                        <input type="text" id="fname" name="firstname" >
                    </div>
                    <div>
                        <label for="E-mail">E-mail</label>
                        <input type="email" id="email" name="email" >
                    </div>
                    <div>                
                        <label for="our website address">Your website address</label>
                        <input type="text" id="" name="" >
                    </div>
                    <div>                
                        <div class=boxtxt>I agree to have my personal data processed by LiveChat, Inc. for chat support. Full policy

                        </div>
                        <div class="checkbox"> 
                            <input type="checkbox" id=" " name=" " >
                            <label for="our website address">Agree</label>
                        </div>
                    </div>
                    <div>
                        <button class="chatbutton button1">Start chat</button>
                    </div>
                            

                
                </form>
            </div>    
        </div>
    </div>







</body>
</html>






Step 2

We create style.css file and it link our popuform.htm file using <link rel="stylesheet"
                 href="style.css">

style.css page

body {font-familyArialHelveticasans-serif;}
* {box-sizingborder-box;}

/* Button used to open the contact form - fixed at the bottom of the page */
/* ## Chart image buttion   ##*/
img {
    width68px;
    height67px;
}
.button{
    background-color#ffffffef/* Green */
    bordernone;
    colorwhite;
    padding6px 14px;
    text-aligncenter;
    text-decorationnone;
    displayinline-block;
    font-size12px;
    margin4px 2px;
    cursorpointer;
    opacity0.8;
    bottom23px;
    right28px;
    width95px;
    positionfixed;
    border-radius50%;
  }

/* The popup form - hidden by default */
.form-popup {
  displaynone;
  positionfixed;
  bottom0;
  right15px;
  border3px solid #f1f1f1;
  z-index9;
}

/* form.html csss  */

p {
   /* color: rgb(95, 92, 92);*/
    text-alignleft;
   padding-top2px;
   padding-bottom2px;
    font-family"Noto Sans"sans-serif;
    box-sizingborder-box;
    -webkit-font-smoothingantialiased;
    -webkit-tap-highlight-colortransparent;
    margin-top-8px;
    /*font-size: 13px;*/
    font-size0.875rem;
    font-weightnormal;
    color: rgb(171717);
    padding-left12px;
  }
  
  
  /* form css   */

  .closediv{
    text-aligncenter;
    
    margin-top-7px;
    grid-column3;
  grid-row4;
  background-colorwhite;  
}

  
  input[type=text], selecttextarea {
    width100%;
    padding10px;
    padding-left50px;
  
    border1px solid #ccc;
    border-radius4px;
    box-sizingborder-box;
    margin-top6px;
    margin-bottom16px;
    resizevertical;
    background-color#faf8f8;
  }
  input[type=email] {
      width100%;
      padding10px;
      padding-left50px;
    
      border1px solid #ccc;
      border-radius4px;
      box-sizingborder-box;
      margin-top6px;
      margin-bottom16px;
      resizevertical;
      background-color#faf8f8;
  
  }
  
  
  
  
  
  
  
  
  
  .container {
    border-radius5px;
    background-color#faf8f8;
    padding20px;
    margin-top30px;
    margin-bottom20px;
    positionfixed;
    margin-left25px;
    width344px;
    height611px;
    max-width100%;
    max-height: calc(100% + 0px);
    min-height0px;
    min-width0px;
    overflow-xhidden;
    box-shadow0 4px 8px 0 rgba(0,0,0,0.2);
      transition0.3s;
  
  }
  
  .form{
      padding26px;
      padding-left17px;
      text-alignleft;
      text-justifyinherit;
      font-size16px;
      padding-top4px;
      
  }
  .form label{
    padding2px;
  
  }
  .form input{
    padding5px;
  }
  
  .formhad{
      font-size10px;
      background-colorwhite;
      margin-top-20px;
      padding-top2px;
      padding-bottom2px;
      text-aligncenter;
      margin-bottom0px;
      font-familySans-serif;
  
      transition0.3s;
      margin-left-21px;
      margin-right-21px;
      grid-column2;
      grid-row4;
  }
  
  .gridsel{
  margin-top25px;
  padding-top6px
  padding-bottom6px;
  padding-left2px;
  padding-right2px;
  margin-bottom28px;
  background-color: rgb(255255255);
  box-shadow0 4px 8px 0 rgba(0,0,0,0.2);
     transition0.3s;
    
  }
  .gridsel .h6{
  font-size17px;
  margin-top2px;
  margin15px;
  }
  
  
  .chartbot{
      
  margin-top5px;
  padding-top16px;
  padding-bottom62px;
  height66px;
  background-color#fffefe;
  border-radius50;
  border: rgb(255255255);
  border-stylesolid;
  box-shadow0 4px 8px 0 rgba(0,0,0,0.2);
  transition0.3s;
  }
  
  
  
  
  
  .p1{
      padding-top0px;
      padding-bottom0px;
      
  }
  
  /*    form box css            */ 
  
  .formbox{
      background-color#ffffff;
      border-stylesolid;
      border: rgb(000);
      padding-top12px;
      padding-bottom0px;
      margin-top26px;
      box-shadow0 4px 8px 0 rgba(0,0,0,0.2);
      transition0.3s;
      
  }
  
  
  .boxtxt{
   
    font-size0.875rem;
    font-weightnormal;
    color: rgb(171717);
    overflow-wrapbreak-word;
    word-breakbreak-word;
  
  }
  .checkbox{
    margin0px;
    font-size14px;
    font-family"Noto Sans"sans-serif;
    color:rgb(104104104);
    text-alignleft;
  
  }
  
  
  /* -----button------  */
  .chatbutton{
    background-color#b63f21ef/* Green */
    bordernone;
    colorwhite;
    padding14px 26px;
    text-aligncenter;
    text-decorationnone;
    displayinline-block;
    font-size12px;
    margin4px 2px;
    cursorpointer;
  
  }
  .button1{
    border-radius8px;
  }

  /*###For wrapdiv ######*/ 
  .wrapper {
    displaygrid;
    grid-template-columns: repeat(31fr);
    gap10px;
    background-colorwhite;
    margin-left-20px;
    margin-right-20px;
    margin-top-20px;
  }
  .div1{

    grid-column1;
  grid-row2 / 5;
  background-colorwhite;
  }

  /* ### min button ####*/
  .minbutton{
    cursorpointer;
    font-size18px;
    bordernone;
    background-colorwhite;
  }


Step:3 we create script file for html form block and none


myscript.js page
function openForm() {
  document.getElementById("myForm").style.display = "block";
}

function closeForm() {
  document.getElementById("myForm").style.display = "none";
}