-3

So I have an unordered list with each li containing an image and text. At a particular breakpoint I'm hiding the text but keeping the image displayed. Is there a way to target only the text without putting a span around it? I'm currently using a span to give it display none, which works fine. I just wanted to see if someone has a more efficient way of doing this.

<ul>
        <li><a href="#" class="btn_task"><img src="images/ICON-XS-tasks.png" /> <span>Tasks</span></a></li>
        <li><a href="#" class="btn_note"><img src="images/ICON-XS-notepad.png" /> <span>Notes</span></a></li>
        <li><a href="#" class="btn_list"><img src="images/ICON-XS-lists.png" /> <span>Lists</span></a></li>
        <li><a href="#" class="btn_outline"><img src="images/ICON-XS-outlines.png" /> <span>Outlines</span></a></li>
    </ul>

@media (max-width: 500px) { ul li span {display: none;}}
Bridget Kilgallon
  • 325
  • 2
  • 3
  • 9

1 Answers1

0

font-size: 0px?

You can only mess up with something like this I suppose.

Nathan Peixoto
  • 312
  • 1
  • 8