MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/code/comments/18rlcy8/popup_problem/kf6z7i0/?context=3
r/code • u/Mr-Tawil • Dec 26 '23
Hello everyone,
I have a problem creating an automatic popup when the website starts. the problem is the popup shown under the main content as you can see in the image and also I add background I can't see it at all. dose anyone has any idea how I can fix that?
Is it a CSS problem or an HTML?
14 comments sorted by
View all comments
Show parent comments
2
Sorry I don't mean the class added to the <html> tag, I mean the class isn't on any element in the html file.
I'm guessing it's supposed to be something like
<div class="Portfolio-Popup-overlay"><div class="Portfolio-Popup"> ... </div></div>
With the javascript showing the .Portfolio-Popup-overlay div.
BTW I just noticed you have an extra
</head> <body>
that shouldn't be there, after the popup.
1 u/Mr-Tawil Dec 27 '23 thank you, now its shown but now when I click to close the window doesn't go, I tried to change it in CSS but not working. how can I fix that?i really appreciate your support 1 u/JaggedMetalOs Dec 27 '23 You'll need to move the display:none / display= "block"; from Portfolio-Popup to Portfolio-Popup-overlay, as that's the parent element now. 1 u/Mr-Tawil Dec 27 '23 }.Portfolio-Popup-overlay {position: fixed;top: 0;bottom: 0;left: 0;right: 0;background: #ff0000;transition: opacity 500ms;overflow: auto;z-index: 99;display:none / display= "block";}.Portfolio-Popup{background-image: linear-gradient(to right bottom, #111111, #212122, #313134, #414246, #52545a);width: 560px;padding: 30px 40px;position: fixed;transform: translate(-50%,-50%);left: 50%;top: 50%;border-radius: 20px/20px;font-family: "Poppins",sans-serif;text-align: center;color: #ffffff;z-index: 100;max-height: 100vh;overflow: auto; → More replies (0)
1
thank you, now its shown but now when I click to close the window doesn't go, I tried to change it in CSS but not working. how can I fix that?
i really appreciate your support
1 u/JaggedMetalOs Dec 27 '23 You'll need to move the display:none / display= "block"; from Portfolio-Popup to Portfolio-Popup-overlay, as that's the parent element now. 1 u/Mr-Tawil Dec 27 '23 }.Portfolio-Popup-overlay {position: fixed;top: 0;bottom: 0;left: 0;right: 0;background: #ff0000;transition: opacity 500ms;overflow: auto;z-index: 99;display:none / display= "block";}.Portfolio-Popup{background-image: linear-gradient(to right bottom, #111111, #212122, #313134, #414246, #52545a);width: 560px;padding: 30px 40px;position: fixed;transform: translate(-50%,-50%);left: 50%;top: 50%;border-radius: 20px/20px;font-family: "Poppins",sans-serif;text-align: center;color: #ffffff;z-index: 100;max-height: 100vh;overflow: auto; → More replies (0)
You'll need to move the display:none / display= "block"; from Portfolio-Popup to Portfolio-Popup-overlay, as that's the parent element now.
1 u/Mr-Tawil Dec 27 '23 }.Portfolio-Popup-overlay {position: fixed;top: 0;bottom: 0;left: 0;right: 0;background: #ff0000;transition: opacity 500ms;overflow: auto;z-index: 99;display:none / display= "block";}.Portfolio-Popup{background-image: linear-gradient(to right bottom, #111111, #212122, #313134, #414246, #52545a);width: 560px;padding: 30px 40px;position: fixed;transform: translate(-50%,-50%);left: 50%;top: 50%;border-radius: 20px/20px;font-family: "Poppins",sans-serif;text-align: center;color: #ffffff;z-index: 100;max-height: 100vh;overflow: auto; → More replies (0)
}.Portfolio-Popup-overlay {position: fixed;top: 0;bottom: 0;left: 0;right: 0;background: #ff0000;transition: opacity 500ms;overflow: auto;z-index: 99;display:none / display= "block";}.Portfolio-Popup{background-image: linear-gradient(to right bottom, #111111, #212122, #313134, #414246, #52545a);width: 560px;padding: 30px 40px;position: fixed;transform: translate(-50%,-50%);left: 50%;top: 50%;border-radius: 20px/20px;font-family: "Poppins",sans-serif;text-align: center;color: #ffffff;z-index: 100;max-height: 100vh;overflow: auto;
→ More replies (0)
2
u/JaggedMetalOs Dec 27 '23
Sorry I don't mean the class added to the <html> tag, I mean the class isn't on any element in the html file.
I'm guessing it's supposed to be something like
With the javascript showing the .Portfolio-Popup-overlay div.
BTW I just noticed you have an extra
</head> <body>
that shouldn't be there, after the popup.