LaniusC Posted October 16, 2020 Share Posted October 16, 2020 <html> <head> <meta name="viewport" content="height=device-height, width=device-width, initial-scale=1.0" /> <link rel="stylesheet" href="style.css"> <script> function close() { document.getElementById("popup").style.display = "none"; } </script> <style> .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 { position:absolute; right:6%; margin-top: 1%; background-color: lightgrey; padding: 2%; } .close:hover { background-color: red; } </style> </head> <body> <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"> </div> </div> </body> </html> Link to comment Share on other sites More sharing options...
dsonesuk Posted October 18, 2020 Share Posted October 18, 2020 Maybe because close() is already a key function used by javascript. Try renaming it. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now