Descendant selector example

Select all paragrahs that are descendants of header and set the size.

by Vimla Ramdoo

HTML

<header>
    <h2>Welcome to our Page</h2>
    <p> Brought to you by Business Web Technologies </p>
</header>
<p>
    This is the main text on the page.
</p>

CSS

/* Set size of paragraph elements  */  
p { font-size: 18px; }

/* Set size of paragraphs that are descendant of headers */
header ,  p { font-size: 9px; }

header {
    background-color: darkblue;
    color: white;
    width: 100%;
}