The :empty pseudo selector will select elements that contain either nothing or only an HTML comment.


div:empty{display: none;}

 

Ref:

https://css-tricks.com/almanac/selectors/e/empty/



Article ID: 50
Created On: Sun, Oct 4, 2020 at 11:48 PM
Last Updated On: Sun, Oct 4, 2020 at 11:48 PM
Authored by: Saeed Nobakht [[email protected]]

Online URL: https://www.navel.ir/article/the-empty-pseudo-selector-will-select-elements-that-contain-either-nothing-or-only-an-html-comment-50.html