Jump to content

The function close() doesn't seem to work really. Does anyone have any suggestions why? Thank you in advance!


Recommended Posts

    <meta name="viewport" content="height=device-height, width=device-width, initial-scale=1.0" />
        <link rel="stylesheet" href="style.css">
        function close() {
            document.getElementById("popup").style.display = "none";
            .popup {
                display: inline;
                position: fixed;
                height: 100%;
                width: 100%;
                z-index: 9999;
                background-color: red;
            .inner-part {
                width: 90%;
                margin-left: 5%;
                margin-top: 50%;
                text-align: center;
                height: 30%;
                background-color: white;
                color: black;
                box-shadow: 0px 0.2vw 6vw black;
            .close {
                margin-top: 1%;
                background-color: lightgrey;
                padding: 2%;
            .close:hover {
                background-color: red;

        <div class="popup" id="popup">
                <div class="inner-part" >
                    <div class="close" onclick="close()" >X</div>
                    <p>Welcome on my website!</p>
                    <p>This website is self written and has many issues. I would love any kind of feedback.</p>
                    <p>Please select your language</p>
                    <img src="en.png">
                    <img src="de.png">

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...