Css special effects problem?

< lify-app > < / lify-app >
< div class= "preLoading" >

<img class="preLoading__image" src="big.png">

< / div >

 lify-app:empty + .preLoading {
        opacity: 1;
        z-index: 100;
    }
    lify-app:empty + .preLoading .preLoading__image {
        animation: preLoadingAnimation 2s linear 2s infinite;
    }
css    
Mar.30,2022

Link description

: both empty and + are selectors: empty means there are no child elements, and + represents the next adjacent element


lify-app:empty indicates that when the lify-app element does not have the state of a child element, "+" looks for a sibling element that follows

write this way, that is, these lify-app styles take effect only when there are no child elements under the css element, otherwise they will not take effect.

for example, if you have child elements, it will not take effect

<lify-app>
  <span>666<span>
</lify-app>
Menu