Due Tuesday, 20 August 2002
body div > * can be described as "any element that is a child of a 'div' that is a descendant of the 'body' element." Describe the following selectors.
a.external:visiteda:link:hover[href]:focus strongtd.navbar a:first-child:linkdiv h1:first-child + ul li:first-child*:lang(fr):first-letterh1 + div * > *:first-lineh2 + p + div *[src] + ptd[class="negative"] div > em[class]table:first-child tr[class="odd subsummary"] td[class~="total"]p:first-letter strong {font-size: 100%}:first-letter, :first-line, :before, :after, :right, :left and :first are all pseudo-elements. Pseudo-elements cannot be combined in the same selector, here is an illegal example: p:first-line:first-letterdiv.answer:first-letter { font-size: 110%; font-weight: bold; color:#990099; }a:link { color: blue; } is a pseudo-class that would make all unvisited links blue, whereas a:visited { color: purple; } would make all visited links purple. Here is an example of another pseudo-class :hover that is combined with another pseudo-class: a:visited:hover { background-color: black; color: white; }. Other pseudo-classes are :active, :focus, and :langdiv + [class="aside"]:first-line em:first-line must be the last selector before the curly brackets. So em cannot be after it.ul > * li * + > *[class] *table > td[bgcolor-="white"]p[id] em.stronger a[href]div#gallery > :hover img[alt|="fig"]***Write a singe rule for the following markup***
div and that contains a :first-child somewhere within it.strong elements containing the text "lo" and "really" (but no others) using a single selector.<body> <h1>Hel<strong>lo</strong> there!</h1> <p>Welcome to my Web site. I'm <strong>so</strong> glad you're here! On this site you can find: </p> <ul> <li><a href="mepics.html">Pictures of me</a>... <ul> <li>...with <a href="friendpics.html">friends</a></li> <li>...with <a href="fampics.html">family</a></li> <li>...with <a href="beerpics.html">beer</a></li> </ul> </li> <li><a href="fluffpics.html">Pictures of my cat Fluffy</a></li> <li><a href="poetry.html">My poetry</a>... <ul> <li>...written to <a href="seriouspoetry.html">be serious</a></li> <li>...written to <a href="funnypoetry.html">be funny</a></li> </ul> </li> <li><a href="favlinks.html">My <em>favorite</em> Web sites</a></li> </ul> <div class="rant"> Want to hear something annoying? <p> I mean, <strong>really</strong> annoying? </p> Well then, here goes. <p> The other day someone wrote telling my site was: </p> <ul> <li>lame</li> <li>stupid</li> <li>narcissistic</li> <li><em>really</em> lame</li> </ul> <p> I <strong>hate</strong> that! Why do people do things like that? After all, if you don't like the Web site, don't come here. I'm proud of <a href="fluffpics.html">my cat</a> and there's nothing wrong with naming a mynx Fluffy anyway. </p> <p> So <em>there</em>. </p> </div> <p> Sorry about that little bit of ranting. I promise to be more cheerful in the future. If you want, e-mail me at <a href="mailto:me@my.web.site">me@my.web.site</a>, but <em>not</em> if you're going to complain. </p> <p>Have a nice day!</p> <div class="footer"> All content copyright <a href="mepics.html">me</a>, on the date I wrote it. </div> </body>