Syntax error Descendent Selectors in CSS

Descendent Selectors in CSS



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;
}
Updated on: 2020-01-30T07:25:02+05:30

488 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements