I want to hide all the li’s (display:none) except the i (fontawesome icon);

تبليغ
سؤال

يرجى شرح بإيجاز لمإذا تشعر أنك ينبغي الإبلاغ عن هذا السؤال.

تبليغ
‎إلغاء

I want to hide all these li’s when i style my navbar for smaller screen sizes that’s why I only want to keep the fontawesome icon and remove all the li’s.

li:not(i) {
display: none;
}
<ul>
<li class=”first”><i class=”fa-brands fa-instagram”></i>Home</li>
<li class=”second”><i class=”fa-brands fa-instagram”></i>Home</li>
<li class=”first”><i class=”fa-brands fa-instagram”></i>Home</li>
<li class=”first”><i class=”fa-brands fa-instagram”></i>Home</li>
<li class=”first”><i class=”fa-brands fa-instagram”></i>Home</li>
</ul>

But after applying this code it doesn’t work.

‫أضف إجابة

تصفح
تصفح

مجهول يجيب