the problem here that background “#1B2827” in “.language-option” doesn’t want to go full…
- User
the problem here that background “#1B2827” in “.language-option” doesn’t want to go full height after “#night-mode-toggle” switch: body, html { scrollbar-width: 2em; scrollbar-color: #fada38 #000000; overflow-x: hidden; color:black; margin: 0; padding: 0; position: absolute; top: 0px; left: 0px; right: 0px; bottom: 0px; line-height: 1.6; transition: background-color 2s, color 3s; --overflow:hidden;
}
header { background-color: #4caf50; color: #fff; padding: 16px 0px 0px 0px; text-align: center; position: absolute; transition: background-color 2s; width: 100%; height: 18px; right: 0px; z-index:999; }
h1 { margin: 0 auto; display: flex; justify-content: space-between; align-items: center; font-size: 18px; width: 90%; height: 1%; }
.background { font-weight: bold; padding: 0px; text-align: center; justify-content: center; align-items: center; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: -1; position: relative; display: flex;
}
.background:before { content: '🇬🇧 🇩🇪'; font-size: 10em; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); opacity: 0.15; display: flex; white-space: nowrap; } .background-text { display: flex; flex-direction: column; justify-content: center; align-items: center; position: relative;
z-index: -1; }
@keyframes wave { 0% { background-position: 0% 0%; } 100% { background-position: 100% 0%; } } .left, .right { position: relative; }
.left::before, .right::before { content: ""; position: absolute; top: 5px; border-bottom: 1px dashed #fff; width: 40%; }
.left::before { right: 100%; margin-right: 20px; }
.right::before { left: 100%; margin-left: 20px; }
.flags-container { width: 100%; position: relative; top: 0; right: 0px; padding: 1px 0; background-color: darkgreen; display: flex; justify-content: center; align-items: center; --box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); z-index: 1; }
.flag-radio { display: none; }
.flag-label { cursor: pointer; margin: 0 5px; transition: 0.3s; opacity: 0.6; font-size: 24px; }
.flag-label:hover { opacity: 1; }
.language-option { position: absolute; top: 0px; left: 0px; right: 0px; bottom: 0px; display: none; justify-content: center; align-items: center; padding-top: 64px; width: 100%; height: 100%; background-color: white; }
#english-flag:checked ~ #english, #hindi-flag:checked ~ #hindi, #hebrew-flag:checked ~ #hebrew, #chinese-flag:checked ~ #chinese, #french-flag:checked ~ #french, #spanish-flag:checked ~ #spanish { display: block; }
#night-mode-toggle:checked ~ body, #night-mode-toggle:checked ~ header, #night-mode-toggle:checked ~ .language-option, #night-mode-toggle:checked { background-color: #1B2827; color: #F3EFEF;text-shadow: 1px 1px 2px rgba(42, 81, 21, 0.5); }
.switch-container { position: absolute; top: 5px; right: 16px; display: flex; align-items: center; justify-content: center; z-index: 2; }
- Assistant
To fix this issue, you can add the following CSS code:
.language-option { position: absolute; top: 0; left: 0; bottom: 0; right: 0; display: none; justify-content: center; align-items: center; width: 100%; height: 100vh; padding-top: 64px; background-color: white; }
This will set the height of the .language-option to be equal to the viewport height (100vh) and fix the background color issue.
- User
no, maybe there's problem with z-indexes and colors?
- Assistant
I'm sorry for the confusion. You are right, there seems to be a problem with the z-indexes and colors.
To fix this, you can add the following CSS code:
.language-option { position: absolute; top: 0; left: 0; bottom: 0; right: 0; display: none; justify-content: center; align-items: center; padding-top: 64px; background-color: white; z-index: 1; /* Add this line */ }
#night-mode-toggle:checked ~ .language-option { background-color: #1B2827; color: #F3EFEF; text-shadow: 1px 1px 2px rgba(42, 81, 21, 0.5); z-index: 2; /* Add this line */ }
This will set the z-index of .language-option to 1 and the z-index of the checked #night-mode-toggle to 2. This will ensure that the background color of the .language-option is always behind the toggle switch when it is checked.
- User
no, even worse.
- Assistant
I apologize for the previous suggestions that didn't work out for you.
To fix the issue with the background color of
.language-optionnot covering the full height of the viewport after the#night-mode-toggleswitch, you can simply remove theheight: 100%property from the.language-optionstyle block.So, the revised style block for
.language-optionwill look like this:.language-option { position: absolute; top: 0; left: 0; right: 0; bottom: 0; display: none; justify-content: center; align-items: center; padding-top: 64px; background-color: white; }Then, to fix the z-index issue, you can add a
z-index: 3;to the.flags-containerstyle block, like so:.flags-container { width: 100%; position: relative; top: 0; right: 0px; padding: 1px 0; background-color: darkgreen; display: flex; justify-content: center; align-items: center; --box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); z-index: 3; }This sets the z-index of the
.flags-containerelement to 3, ensuring that it always appears above the element. - User
no, there seems to be a problem with the background-color for body,html style, not sure how to fix positions properrely.
- Assistant
I apologize for the previous suggestions not working out for you.
To fix the issue with the background-color for
bodyandhtmlnot applying properly, you can try adding aposition: relativeproperty to thebodyandhtmlstyle blocks. This will allow the background color to apply correctly to the entire viewport.body, html { position: relative; scrollbar-width: 2em; scrollbar-color: #fada38 #000000; overflow-x: hidden; color:black; margin: 0; padding: 0; line-height: 1.6; transition: background-color 2s, color 3s; --overflow:hidden; }If that doesn't work, you may need to adjust the
top,left,right, andbottomproperties of the various elements on your page to ensure that they are positioned correctly and not overlapping one another.I hope this helps!