mixbo
Posted on June 13, 2020
:empty
pseudo-class selector can used when you need select empty dom in CSS let's show case
<!-- will be selector -->
<div></div>
<div></div>
<div><!-- comment --></div>
<!-- will not selected if has comment with line break -->
<div>
<!-- comment here -->
</div>
<!-- will not be select if contain space -->
<div> </div>
<!-- not be select if contain content-->
<div> anything </div>
<!-- will be selector -->
<div></div>
:empty
just used for select DOM which contain nothing even comment.
Hope it can help you :)
💖 💪 🙅 🚩
mixbo
Posted on June 13, 2020
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.
Related
programming 10 Essential Tips for Junior Frontend Developers to Excel in Their Career
November 10, 2024