How To Make a Modal Box With CSS and JavaScript; | how to create popup in html with css


Just Copy and past this code in html file or custom html widget

PopUP
Creating PopUP X
Dark card title

Some quick example text to build on the card title and make up the bulk of the card's content.

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
    <title>PopUP</title>
    <style>
        .card {
            position: absolute;
            top: 200px;
        }
    </style>
</head>

<body>

    <div class="container">
        <div class="card border-dark " style="max-width:auto;">
            <div class="card-header">Creating PopUP
                <span class="btn btn-danger float-right" id="closepop"> X</span></div>
            <div class="card-body text-dark">
                <h5 class="card-title">Dark card title</h5>
                <p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
            </div>
        </div>
        <script>
            $(".card").hide();
            $("#closepop").click(function() {
                $(".card").fadeOut();
            });
            setTimeout(function() {
                $(".card").fadeIn();
            }, 3000);
        </script>

</body>

</html>