Descendent Selectors in CSS

JavascriptWeb DevelopmentFront End Scripts

Suppose you want to apply a style rule to a particular element only when it lies inside a particular element. As given in the following example, style rule will apply to <em> element only when it lies inside <ul> tag.

ul em {
   color: #FFFF00;
}

Suppose now for <ol> element and style rule applied to <strong>:

ol strong {
   color: #808000;
}
raja
Updated on 30-Jan-2020 07:25:02

Advertisements