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"
<z><z x="x">
<z />
<a i="x">my text</a>

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. The comment form expects plain text. If you need to format your text, you can use HTML elements such strong, blockquote, cite, code and em. For formatting code as HTML automatically, I recommend tohtml.com.

You may subscribe to this blog by email.