We can specify the style of an element only when it is inside another element. To accomplish this, we use the concept of descendant selectors.
The syntax for declaring a descendant selector is:
[Parent Selector] [Child Selector] {
property:value;
...
}
The style defined above will apply to child selectors only when they are inside the parent selector. Such declarations can go on for more than two levels.
For example, in the declaration below,
li b {
color:yellow;
}
means that text in the element inside the
No comments:
Post a Comment