Quick CSS quiz

Given these CSS instructions,


z[x] > a[i] {color: blue;}
z z[x] a {text-decoration: underline;}
z > z a , z z z + a { color: red ;}

what will be the color of the text in the following XML file?

<?xml version="1.0" encoding="ISO-8859-1" ?>
<?xml-stylesheet type="text/css"
href="test.css"?>
<z><z x="x">
<z />
<a i="x">my text</a>
</z>
</z>

Daniel Lemire, "Quick CSS quiz," in Daniel Lemire's blog, August 21, 2008.

Published by

Daniel Lemire

A computer science professor at the University of Quebec (TELUQ).

3 thoughts on “Quick CSS quiz”

  1. Wow, and I thought I had a good understanding of CSS! I didn’t know you could apply it to XML and I don’t recognize half of that syntax! I am going to guess blue though since the first rule appears to be a more fine grained rule

Leave a Reply

Your email address will not be published.

You may subscribe to this blog by email.