How to do this?

  • On screens in which the name of the tabs fit in one line, there should be only text.
  • On screens in which the name of the tabs does not fit in one line, there should be small (pictures - not bootstrap icons) logo.jpg 50x50

/* Π‘Π°Π·ΠΎΠ²Ρ‹ΠΉ ΠΊΠΎΠ½Ρ‚Π΅ΠΉΠ½Π΅Ρ€ Ρ‚Π°Π±ΠΎΠ² */ .tabs { min-width: 320px; max-width: 800px; padding: 0px; margin: 0 auto; } /* стили сСкций с содСрТаниСм */ section { 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; } /* ΡˆΡ€ΠΈΡ„Ρ‚-ΠΈΠΊΠΎΠ½ΠΊΠΈ ΠΎΡ‚ Font Awesome Π² Ρ„ΠΎΡ€ΠΌΠ°Ρ‚Π΅ Unicode */ .tabs label:before { font-family: fontawesome; font-weight: normal; margin-right: 10px; } .tabs label[for*="1"]:before { content: "\f19a"; } .tabs label[for*="2"]:before { content: "\f17a"; } .tabs label[for*="3"]:before { content: "\f13b"; } .tabs label[for*="4"]:before { content: "\f13c"; } /* измСнСния стиля Π·Π°Π³ΠΎΠ»ΠΎΠ²ΠΊΠΎΠ² Π²ΠΊΠ»Π°Π΄ΠΎΠΊ ΠΏΡ€ΠΈ Π½Π°Π²Π΅Π΄Π΅Π½ΠΈΠΈ */ .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">Π’ΠΊΠ»Π°Π΄ΠΊΠ° 1</label> <input id="tab2" type="radio" name="tabs"> <label for="tab2" title="Π’ΠΊΠ»Π°Π΄ΠΊΠ° 2">Π’ΠΊΠ»Π°Π΄ΠΊΠ° 2</label> <input id="tab3" type="radio" name="tabs"> <label for="tab3" title="Π’ΠΊΠ»Π°Π΄ΠΊΠ° 3">Π’ΠΊΠ»Π°Π΄ΠΊΠ° 3</label> <input id="tab4" type="radio" name="tabs"> <label for="tab4" title="Π’ΠΊΠ»Π°Π΄ΠΊΠ° 4">Π’ΠΊΠ»Π°Π΄ΠΊΠ° 4</label> <section id="content1"> <p> Π—Π΄Π΅ΡΡŒ Ρ€Π°Π·ΠΌΠ΅Ρ‰Π°Π΅Ρ‚Π΅ любоС содСрТаниС.... </p> </section> <section id="content2"> <p> Π—Π΄Π΅ΡΡŒ Ρ€Π°Π·ΠΌΠ΅Ρ‰Π°Π΅Ρ‚Π΅ любоС содСрТаниС.... </p> </section> <section id="content3"> <p> Π—Π΄Π΅ΡΡŒ Ρ€Π°Π·ΠΌΠ΅Ρ‰Π°Π΅Ρ‚Π΅ любоС содСрТаниС.... </p> </section> <section id="content4"> <p> Π—Π΄Π΅ΡΡŒ Ρ€Π°Π·ΠΌΠ΅Ρ‰Π°Π΅Ρ‚Π΅ любоС содСрТаниС.... </p> </section> </div> 

  • I think that here you need to watch jQuery and JavaScript in Toronto ... - Shnur

0