Made tabs on html / css for example. Tabs only work if they contain plain text. If you insert a form, it is not displayed at all. The code appears in the console

/* Π±Π°Π·ΠΎΠ²Ρ‹ΠΉ ΠΊΠΎΠ½Ρ‚Π΅ΠΉΠ½Π΅Ρ€ Ρ‚Π°Π±ΠΎΠ² */ .tabs { min-width: 320px; max-width: 800px; padding: 0px; margin: 0 auto; } /* стили сСкций с содСрТаниСм */ section.tabs2 { display: none; padding: 15px; background: #fff; border: 1px solid #ddd; } .tabs input { display: none; } /* стили Π²ΠΊΠ»Π°Π΄ΠΎΠΊ (Ρ‚Π°Π±ΠΎΠ²) */ .tabs label { display: inline-block; margin: 0 0 -1px; padding: 15px 25px; font-weight: 600; text-align: center; color: #aaa; border: 1px solid #ddd; background: #f1f1f1; border-radius: 3px 3px 0 0; } /* измСнСния стиля Π·Π°Π³ΠΎΠ»ΠΎΠ²ΠΊΠΎΠ² Π²ΠΊΠ»Π°Π΄ΠΎΠΊ ΠΏΡ€ΠΈ Π½Π°Π²Π΅Π΄Π΅Π½ΠΈΠΈ */ .tabs label:hover { color: #888; cursor: pointer; } /* стили для Π°ΠΊΡ‚ΠΈΠ²Π½ΠΎΠΉ Π²ΠΊΠ»Π°Π΄ΠΊΠΈ */ .tabs input:checked + label { color: #555; border: 1px solid #ddd; border-top: 1px solid #009933; border-bottom: 1px solid #fff; background: #fff; } /* активация сСкций с ΠΏΠΎΠΌΠΎΡ‰ΡŒΡŽ ΠΏΠ΅Ρ€Π΅ΠΊΠ»ΡŽΡ‡Π°Ρ‚Π΅Π»Ρ :checked */ #tab1:checked ~ #content1, #tab2:checked ~ #content2, #tab3:checked ~ #content3, #tab4:checked ~ #content4 { display: block; } /* ΠΌΠ΅Π΄ΠΈΠ° запросы для Ρ€Π°Π·Π»ΠΈΡ‡Π½Ρ‹Ρ… Ρ‚ΠΈΠΏΠΎΠ² носитСлСй */ @media screen and (max-width: 680px) { .tabs label { font-size: 0; } .tabs label:before { margin: 0; font-size: 18px; } } @media screen and (max-width: 400px) { .tabs label { padding: 15px; } } 
  <div class="tabs"> <input id="tab1" type="radio" name="tabs" checked> <label for="tab1" title="Π²ΠΊΠ»Π°Π΄ΠΊΠ° 1">Π’Ρ…ΠΎΠ΄</label> <input id="tab2" type="radio" name="tabs"> <label for="tab2" title="Π²ΠΊΠ»Π°Π΄ΠΊΠ° 2">РСгистрация</label> <section class="tabs2" id="content1"> <form id="modal-form"> <div id="fields"> <p><input name="email" placeholder="Email" id="contact-modal-form-imya"></p> <p><input name="password" placeholder="Password" id="contact-modal-form-phone" type="password"></p> <p><input type="submit" value="Π’ΠΎΠΉΡ‚ΠΈ" id="contact-modal-form-bttn"></p> </div> </form> </section> <section class="tabs2" id="content2"> <form id="modal-form"> <div id="fields2"> <p><input name="email" placeholder="Email" id="contact-modal-form-imya"></p> <p><input name="password" placeholder="Password" id="contact-modal-form-phone" type="password"></p> <p><input name="promo" placeholder="ΠŸΡ€ΠΎΠΌΠΎΠΊΠΎΠ΄" id="contact-modal-form-imya"></p> <p><input type="submit" value="РСгистрация" id="contact-modal-form-bttn"></p> </div> </form> </section> </div> 

  • .tabs input { display: none; } .tabs input { display: none; } ?? - Igor
  • @Igor, I'm stupid) or already in my eyes dazzled) thanks - Victor
  • It's my pleasure. Successes! - Igor

0