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>