Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS CSS selector for parent with blank element Reply To: CSS selector for parent with blank element

#262799
Paulie_D
Member

Is there any other HTML/CSS workaround to hide <li> elements with an empty<p> ? maybe with data selectors?

AS Beverley said, you need to be able to specifically identify the li that have an empty p.

How you do that is up to you, whether by applying a class or data-attribute is up to you but it will have to be hard-coded in the HTML.

For instance:

<li id="size1" class="size">
  <p>Queen</p>
  <p>80" x 90"</p>
</li>

<li id="size2" class="size has-empty-p">
  <p>King</p>
  <p></p> <!-- N/A -->
</li>