我想添加CSS
只爲listing-system
類,但子類「expired
」。我如何努力爲它寫CSS
,任何人都可以幫助我。由於如何編寫基於子類的父類的css?
<div class="listing-system">
<div class="listing-system-row">
<div class="listing-system-row-image">
<a href="#" style="background-image: url('#')">
<div class="ribbon expired">
Expired
</div><!-- /.ribbon -->
</a>
</div><!-- /.listing-system-row-image -->
</div><!-- /.listing-system-row-actions -->
</div><!-- /.listing-system-row -->
<div class="listing-system">
<div class="listing-system-row">
<div class="listing-system-row-image">
<a href="#" style="background-image: url('#')">
<div class="ribbon">
Pending
</div><!-- /.ribbon -->
</a>
</div><!-- /.listing-system-row-image -->
</div><!-- /.listing-system-row-actions -->
</div><!-- /.listing-system-row --
可能重複https://stackoverflow.com/questions/1014861/is-there-a-css-parent-selector –
可能的複製[是否有一個CSS選擇器父?](HTTPS:/ /stackoverflow.com/questions/1014861/is-there-a-css-parent-sele ctor) –
':has'選擇器在css3中被刪除,所以你可以選擇基於子類的父類 –