How to have html popup appear over main html page?

you can set css to the popup div which u want to show over the html page.
Consider the following eg:

#mainPage {
  width: 100%;
  height: 100%
}

#popUp {
  display: none;
  z-index: 100;
  width: 200px;
  height: 50px;
  background: #ADD;
}
<html>

<head>
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>

</head>

<body>
  <div id="mainPage">
    <img src="https://lh4.ggpht.com/wKrDLLmmxjfRG2-E-k5L5BUuHWpCOe4lWRF7oVs1Gzdn5e5yvr8fj-ORTlBF43U47yI=w300" width="20%" />
  </div>
  <div id="popUp">
    <p>Hello !!! It's a popup div </p>
  </div>
</body>
<script type="text/javascript">
  $(function() {
    $('#mainPage img').on('click', function() {
      $('#popUp').show();
    });
  });
</script>

</html>

Leave a Comment