ha-ha. css and html only! I’m super master! just pure awesomeness, and 0 scripts! it is…
- User
ha-ha. css and html only! I’m super master! just pure awesomeness, and 0 scripts! it is possible to make proper looking and functioning site with with only css and html! using only css and html also makes webpage secure as fuck! yes, I’m awesome! what next? there’s some css code that can be used to make a dark mode switcher button for “language-option” text containers using only pure css. any ideas on proper integration or implementation of this dark-mode switcher to the actual language selector page?: you splited text containers on two, which is not acceptable, because there will be stored the entire page with tons of texts and style formattings. need to make this switcher to apply dark-mode through its own body, but how to implement this by using only css, is a mystery! you don't read carefully what users writing to you. I told you that I want to achieve this by using css only, but you simply don't cares or listening...:
header { background-color: #4CAF50; color: #FFF; padding: 16px 0px 0px 0px; text-align: center; position: relative; }
h1, h2, h3, h4, h5, h6 { margin: 0 auto; display: flex; justify-content: space-between; align-items: center; font-size: 18px; width: 90%; height: 1%;
}
.left, .right { position: relative; }
.left::before, .right::before { content: ‘’; position: absolute; top: 50%; border-bottom: 1px dashed #FFF; width: 40%; }
.left::before { right: 100%; margin-right: 20px; }
.right::before { left: 100%; margin-left: 20px; }
.flags-container { position: fixed; top: 0; left: 0; right: 0; --padding: 3px 0; background-color: white; display: flex; justify-content: center; align-items: center; --box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); z-index: 10; }
.flag-radio { display: none; }
.flag-label { cursor: pointer; margin: 0 10px; transition: 0.3s; opacity: 0.6; font-size: 24px; }
.flag-label:hover { opacity: 1; }
.language-option { position: run-in; top: 0; left: 0; right: 0; bottom: 0; display: none; justify-content: center; align-items: center; padding-top: 50px; /* adjust based on flags container height */ }
#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; } main p { margin-bottom: 10px; } main a { color: #4CAF50; text-decoration: none; }
section { margin-bottom: 30px; }
- Assistant
To add a dark-mode switcher button to the language selector page using only CSS, you can use the :checked pseudo-class on the flag-radio input elements and the adjacent sibling selector (+) to style the language-option containers when the corresponding flag is checked. Here is an example: