How much I did not torment the search engine, and there was no solution to this issue. Of course, you can always use JS and this is normal, but sometimes the <!-- select --> <label class="selectGeneral" placeholder="select your OS..."> <!-- , , placeholder --> <!-- radio - select , - select --> <input type="radio" name="OS"> <!-- wrapper --> <div> <!-- radio option --> <input type="radio" name="OS" value="linux" id="OS[linux]" > <!-- option --> <label for="OS[linux]">linux</label> <input type="radio" name="OS" value="windows" id="OS[windows]" > <label for="OS[windows]">windows</label> <input type="radio" name="OS" value="other" id="OS[other]" > <label for="OS[other]">other</label> </div> </label> label.selectGeneral { display: block; position: relative; } /** placeholder **/ label.selectGeneral:before { content: attr(placeholder); /** placeholder **/ display: inline-block; position: absolute; top: 0; left: 0; z-index: -1; max-width: 100%; text-align: left; white-space: nowrap; /** **/ color: #adadad; overflow-x: hidden; /** **/ } /** **/ label.selectGeneral:after { content: "<>"; display: inline-block; position: absolute; top: 0; right: 0; text-align: center; background-color: #ffffff; transform: rotate(90deg); } label.selectGeneral input, label.selectGeneral label { display: none; } label.selectGeneral div { min-width: 100%; max-height: 500px; /** **/ overflow-x: hidden; } /** select , wrapper **/ label.selectGeneral input[type="radio"]:checked ~ div { position: absolute; /** **/ top: < label.selectGeneral>; /** , placeholder **/ overflow-y: auto; } /** label wrapper' select **/ label.selectGeneral input[type="radio"]:checked ~ div > label, /** **/ label.selectGeneral input[type="radio"]:checked + label { display: block; /** **/ } /** select **/ label.selectGeneral input[type="radio"]:checked ~ div > label:hover { background-color: #ffa834; } /** select, label **/ label.selectGeneral input[type="radio"]:not(:checked) ~ div > input[type="radio"]:checked + label { position: relative; z-index: -1; } Source: https://habr.com/ru/post/248243/
All Articles